[squid-users] redirect based on url (302)

uppsalanet fredrik at pipemore.se
Wed Oct 31 10:27:20 UTC 2018


Hi Amos,
Is there a git that I can use to push stuff up?

I think you need to split the string in an other way, look into this
example:
#!/usr/bin/perl
use strict;
use warnings;

$|=1;
while (<>) {
     my $string = $_;
     print "Received '\$_' = ".$_."\n";       

     $string =~ m/^(\d+)\s(.*)$/;
     print "After regexp '\$string' = ".$string."\n";
     print "After regexp '\$1' = ".$1."\n";           
     print "After regexp '\$2' = ".$2."\n"; 

     ### Original split from sorce ###
     ### This doesn't split anything looks like elements of an array?
     #my ($cid, $uid) = ($1, $2);
    
     ### Split the string ###
     ### Those two split based on one or more spaces
     #my ($cid, $uid) = split(/\s+/ ,$_);
     my ($cid, $uid) = split;
     $cid =~ s/%(..)/pack("H*", $1)/ge;
     $uid =~ s/%(..)/pack("H*", $1)/ge;
     print "After split \$cid = ".$cid."\n";
     print "After split \$uid = ".$uid."\n";
}

Output from above with intake value '*130.238.000.00 muse.jhu.edu -*':
Received '$_' = 130.238.000.00 muse.jhu.edu -
After regexp '$string' = 130.238.000.00 muse.jhu.edu -
/Use of uninitialized value $1 in concatenation (.) or string at
./sed_test_reg.pl line 13, <> line 1.
After regexp '$1' = 
Use of uninitialized value $2 in concatenation (.) or string at
./sed_test_reg.pl line 14, <> line 1.
After regexp '$2' = /
*After split $cid = 130.238.000.00
After split $uid = muse.jhu.edu*

Cheers
Fredrik



--
Sent from: http://squid-web-proxy-cache.1019090.n4.nabble.com/Squid-Users-f1019091.html


More information about the squid-users mailing list