Tag Archives: perl

Command line perl replacing sed,awk

While updating svn of framework3 in Backtrack, it failed as it was locked. So I can resolve by removing all the lock files in the folders. I tried to pipe the list of files to rm but failed. So thought … Continue reading

Posted in Articles, Notes | Tagged | Leave a comment

Perl – References

References in Perl is just imitation of Pointers in C In C,   *p = &var; In Perl, $p = \$var; These references can be applied to all kinds of variables, function, hashes and arrays. Just add \ before the variable/function … Continue reading

Posted in Notes, Tutorials | Tagged , | Leave a comment

Perl Files Notes 3

Reading from Files my $var; read (FILE, $var, 1024); #reading in block size Similarly write(FILE, $var, 1024); This works fantastically when dealing with binary files so that fetching and writing is fast and efficient. Perl provides another set of functions … Continue reading

Posted in Notes | Tagged , | Leave a comment

Perl Notes 2

Files   Standard Files STDIN STDOUT STDERR   To read Input from Keyboard $ input = <STDIN>;   To read input from keyboard until Ctrl+D or Ctrl+Z is pressed while (<STDIN>){    #input read to $_         print(); }   To Remove the … Continue reading

Posted in Notes, Uncategorized | Tagged | Leave a comment

Perl Notes

Perl Notes String Literals Single quotes are blind. Perl starts from ‘ and stops the literal till ‘ blindly. Double quotes parse the literal for special characters such as \t,\n\r,\U..\E and variables$var \l Change the next character to lower case … Continue reading

Posted in Notes, Tutorials | Tagged , | 1 Comment