Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But that just gets me:#!/usr/bin/perl use strict; use warnings; my $file = "/path/to/some/file"; open ( FILE, '>', $file ) or die "Can't open $file for writing.\n"; while () { <>; last unless /\S/; print FILE; } close FILE or die "Can't close $file.\n";
Where and how do I initialize that?Use of uninitialized value $_ in pattern match (m//) at...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: uninitialized value $_
by Corion (Patriarch) on Mar 28, 2016 at 16:21 UTC | |
by Anonymous Monk on Mar 28, 2016 at 17:04 UTC | |
by Paladin (Vicar) on Mar 28, 2016 at 17:16 UTC | |
by Anonymous Monk on Mar 28, 2016 at 18:42 UTC | |
by LanX (Saint) on Mar 29, 2016 at 00:08 UTC | |
| |
by Marshall (Canon) on Mar 28, 2016 at 22:26 UTC | |
Re: uninitialized value $_
by shadowsong (Pilgrim) on Mar 31, 2016 at 15:50 UTC |