in reply to Re^4: read an integer from a file
in thread read an integer from a file
"it doesn't work" is a singularly useless phrase in IT.
Nevertheless, I googled "squid perl redirect" and found the script I think you are using as a pattern and adapted it for what I think you are trying to do.
Try this outside of squid first. If it works on the command line, but with squid, it's probably permissions or the file path. Check the squid logs for more information.#!/usr/bin/perl use strict; use warnings; use IO::All; use 5.010; $| = 1; while (<>) { my $status = io('status.txt')->all; my $url = ( split )[0]; if( not $status # almost same as if( $status == 0 ) and $url =~ /\Q123.1.34.107:8080\E/ ) { say "301:http://123.1.34.107:8080/Web" } else { say $url } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: read an integer from a file
by Anonymous Monk on Jun 16, 2010 at 08:26 UTC |
In Section
Seekers of Perl Wisdom