in reply to Perl - pattern matching
if i try to run the script on Windows one it failsAnd the fqdn of that Windows host is just one single word, right? Try chomping it like this:
update: no, ([^.]+) won't dochomp(my $fqdn = `hostname`); # OR, much better: my ($hostname) = `hostname` =~ /([-a-zA-Z0-9]+)/; $hostname=~ tr/A-Z/a-z/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl - pattern matching
by McA (Priest) on Mar 31, 2014 at 14:08 UTC | |
|
Re^2: Perl - pattern matching
by fabrizio_start_perl (Novice) on Mar 31, 2014 at 11:48 UTC |