Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-08-20 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls