Help for this page

Select Code to Download


  1. or download this
    my $datafolder = "F:/Perl_program";
    
  2. or download this
    my $dbh = DBI->connect( ... );
    
  3. or download this
    DBI->connect ( ... ) or die "Cannot connect: $DBI::errstr";
    
  4. or download this
    open FINAL, "<final2.csv" or die();
    
  5. or download this
    open(my $fh, "<", "input.txt") or die "cannot open < input.txt: $!";
    open(my $fh, ">", "output.txt") or die "cannot open > output.txt: $!";
    
  6. or download this
    our %hash1;
    
  7. or download this
    while (<FINAL>) {
        our ($username, $date_modified) = split;
        $hash1{$username} = $date_modified;
    }
    
  8. or download this
    $ perl -Mstrict -Mwarnings -le 'for (0..1) { our $x = $_ } print $x'
    Variable "$x" is not imported at -e line 1.
    ...
    
    $ perl -Mstrict -Mwarnings -le 'our $x; for (0..1) { $x = $_ } print $
    +x'
    1
    
  9. or download this
    if (our $username = our $fullname){
    
  10. or download this
    if ($username eq $fullname) {
    
  11. or download this
    our $line1;
    ...
    our @lines1 = (<FINAL>);
    ...
    foreach $line1(@line1){
    
  12. or download this
    our @lines1 = (<FINAL>);
    ...
    for my $line1 (@line1) {
    
  13. or download this
    (our $username, our $date_modified) = split(',',$line1,2);
    
  14. or download this
    our ($username, $date_modified) = ...