This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
notes:perl_cheat_sheet [2026/07/17 19:58] 114.119.152.46 old revision restored (2026/06/25 08:12) |
notes:perl_cheat_sheet [2026/07/24 13:03] (current) 47.79.201.51 old revision restored (2026/06/15 21:28) |
||
|---|---|---|---|
| Line 14: | Line 14: | ||
| * Parenthesis are optional unless part of syntax. | * Parenthesis are optional unless part of syntax. | ||
| * '' | * '' | ||
| + | * '' | ||
| ===== Numbers ===== | ===== Numbers ===== | ||
| Line 90: | Line 91: | ||
| * ''<>'' | * ''<>'' | ||
| chomp; | chomp; | ||
| - | print "It was $_ that I saw!\n"; | + | print LOGFILE |
| }</ | }</ | ||
| + | * '' | ||
| + | print sort <>; | ||
| + | * C-like printf function %g for number auto-format, | ||
| + | my $format = "The items are: | ||
| + | printf $format, @items; | ||
| + | printf "The items are: | ||
| + | </ | ||
| + | * Filehandles can be barewords (upper-cased) or variables. Special filehandles are : STDIN, STDOUT, STDERR, DATA, ARGV, and ARGVOUT .<code perl> | ||
| + | open BEDROCK, '> | ||
| + | open LOG, '>>: | ||
| + | open my $bedrock, '>: | ||
| + | binmode STDOUT, ': | ||
| + | * '' | ||
| ===== User Subroutines ===== | ===== User Subroutines ===== | ||