in reply to read an integer from a file
#!/usr/bin/perl use strict; use warnings; $| = 1; while ( defined( $_ = <ARGV> ) ) { my @X = split( " ", $_, 0 ); my $url = $X[0]; open( MYFILE, 'status2.txt' ) or die "Couldn't open file!"; my $a = <MYFILE>; close(MYFILE); print "$a\n"; if ( $a == 0 ) { if ( not $url =~ m[^http://123.1.34.107:8080] ) { $_ = $url; s[^http://(.*)(.*)][http://123.1.34.107:8080]; print "301:$_\n"; } else { print "$url\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read an integer from a file
by long (Novice) on Jun 21, 2010 at 03:27 UTC | |
by ikegami (Patriarch) on Jun 21, 2010 at 04:16 UTC | |
by long (Novice) on Jun 21, 2010 at 07:24 UTC | |
by ikegami (Patriarch) on Jun 21, 2010 at 07:40 UTC | |
by long (Novice) on Jun 21, 2010 at 08:00 UTC | |
|