#! /usr/bin/perl -w use strict; my $test = "10.100.71.67.log:MikroTik v2.9.50"; my ($ip,$model) = split /:/,$test; $model =~ s/\.log$//; die if $model =~ /log/; print "<$ip> <$model>\n"; output [john@scan log]$ ./test.pl <10.100.71.67.log> <MikroTik v2.9.50> [john@scan log]$ perl -v This is perl, v5.8.8 built for i386-linux-thread-multi
I expected ".log" to be gone or die!
Update: sorry - obvious!
20090123 Janitored by Corion: Restored original content above the update
In reply to subsitute s/ and match m/ failure by kp2a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |