Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

transiency's scratchpad

by transiency (Sexton)
on Mar 07, 2009 at 17:09 UTC ( [id://749061]=scratchpad: print w/replies, xml ) Need Help??

  $shell = "/bin/sh"; system $shell "-sh","-norc"
system { "/bin/sh" } "-sh","-norc"
Forces interactive shell In Perl5, a useful trick is to use the escape sequence \Q \E to quote metacharacters so that they won't be interpreted: print if m/\Q$user_pattern\E/o;

Oooh @ $|++ and its applications to cgi
#!/usr/bin/perl ### Strange MySQL Error ### use warnings; use CGI; use DBI; print "Content-type: text/html\r\n\r\n"; my $time = localtime; my $driver = "DBI:mysql:foo"; my $username = "bar"; my $password = "baz"; $dbh = DBI->connect($driver, $username, $password) or die $DBI::errst +r; open(F, "file.txt") or die; while(<F>){ $bat = somefunction($_); my $entry_added = $dbh->do("INSERT INTO `foo`.`table` (`boo`, `bat`) +VALUES ('$_', '$bat')", undef, 'DONE') or &dbdie; }

http://perlmonks.com/index.pl?node_id=105674
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found