Search Results

Showing results 1 to 11 of 11
Search took 0.01 seconds.
Search: Posts Made By: Comatose ; Forum: Perl and child forums
Forum: Perl Apr 4th, 2009
Replies: 4
Views: 624
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
#!/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
Posted By Comatose
#!/usr/bin/perl
system("cat '/something/something/something/darkside.txt'");
Forum: Perl Jan 20th, 2009
Replies: 12
Solved: CSV File Issue
Views: 1,933
Posted By Comatose
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
Posted By Comatose
aha, maybe you should put the entire thing inside of the while loop ;)
Forum: Perl Jan 19th, 2009
Replies: 8
Views: 939
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
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
Posted By Comatose
Showing results 1 to 11 of 11

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC