Forum: Perl Apr 4th, 2009 |
| Replies: 4 Views: 624 You need to remove the 'mysql' parameter from connect. Should look something like this:
use DBI;
$dsn="DBI:mysql:database=mysql";
$dbh=DBI->connect($dsn, 'root', 'root', {RaiseError => 1}); |
Forum: Perl Apr 1st, 2009 |
| Replies: 4 Views: 1,551 ah, you are missing a slash of some kind it seems... you are escaping the first backslash with the second. You probably need to add something like this:
$map_drive =... |
Forum: Perl Mar 31st, 2009 |
| Replies: 4 Views: 1,551 Wait What?
You're running a script on *nix, and want that script to map a drive on a windows machine????? |
Forum: Perl Feb 10th, 2009 |
| Replies: 4 Views: 641 #!/usr/bin/perl
$filename = "/root/file";
$var = `cat $filename | wc -l`;
print "$var";
EDIT: you shouldn't be stomping around a system as root. |
Forum: Perl Feb 10th, 2009 |
| Replies: 4 Views: 641 #!/usr/bin/perl
system("cat '/something/something/something/darkside.txt'"); |
Forum: Perl Jan 20th, 2009 |
| Replies: 12 Views: 1,933 just check for the newline characters and replace them...something like:
$linefromfile =~ s/\n//gi; Just remember though, that you will have to manually add your own newline character ("\n")... |
Forum: Perl Jan 20th, 2009 |
| Replies: 8 Views: 939 aha, maybe you should put the entire thing inside of the while loop ;) |
Forum: Perl Jan 19th, 2009 |
| Replies: 8 Views: 939 have you tried outputting the value of $thinkingof during each guess? This will help you to at least ensure that the randomness works. |
Forum: Perl Dec 29th, 2008 |
| Replies: 5 Views: 1,418 Well, the first step in any perl app when using the dbi interface is to make sure perl knows to use it:
use DBI;
Then, you want to make perl connect to the database using the DBI interface, so,... |
Forum: Perl Dec 28th, 2008 |
| Replies: 5 Views: 1,418 Not to distract from your original question (ie: how to run commands from perl) but, if accessing a database is what you want to do, why not simply do so directly from Perl, using say.... The DBI... |
Forum: Perl Jul 29th, 2006 |
| Replies: 2 Views: 1,659 |