Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Little annoying mistakes ... of others

by szabgab (Priest)
on Dec 06, 2008 at 17:11 UTC ( #728569=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print "type in something: ";
    my $line = <STDIN>;
    $line = chomp $line;
    
  2. or download this
    print "type in something: ";
    my $line = <STDIN>;
    chomp $line;
    
  3. or download this
    my @data = qw(foo bar baz);
    @data = map { s/./X/ } @data;
    print "@data\n";
    
  4. or download this
    my @data = qw(foo bar baz);
    @data = map { s/./X/; $_} @data;
    print "@data\n";
    
  5. or download this
    my $filename = 'input.txt';
    open my $fh, '<', $filename || die $!;
    
  6. or download this
    open my $fh, '<', ($filename || die $!);
    
  7. or download this
    my $filename = 'input.txt';
    open(my $fh, '<', $filename) or die $!;
    
  8. or download this
    my @names = qw(A B C);
    foreach my $name (<@names>) {
        print "$name\n";
    }
    
  9. or download this
    my(@names) = ('A', 'B', 'C');
    use File::Glob ();
    foreach my $name (glob(join($", @names))) {
        print "$name\n";
    }
    
  10. or download this
    my $x = 42;
    if ($x = /x/) {
        print "ok\n";
    }
    
  11. or download this
    my $x = 42;
    print is_foo_or();
    ...
    sub foo {
        return 0;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://728569]
Approved by GrandFather
Front-paged by GrandFather
help
Chatterbox?
[ambrus]: 1nickt: the tea didn't have sugar or honey or lemon or milk. or even caffeine in a significant quantity. it's really "colored water", warm water with some fruit smell to make it more pleasant than ordinary warm water.
[ambrus]: 1nickt: in theory, it shouldn't hurt the electronics, but also could temporarily cause problems until it dries, and the inside of the keyboard doesn't dry quickly, because it's closed.
[ambrus]: 1nickt: that's the theory. the theory is also that it should have dried by Sunday morning, but it didn't. so I dunno.
[ambrus]: I'll try today evening if it works now.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2017-11-21 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (302 votes). Check out past polls.

    Notices?