Search Results

Showing results 1 to 40 of 146
Search took 0.42 seconds.
Search: Posts Made By: Comatose ; Forum: Perl and child forums
Forum: Perl Apr 4th, 2009
Replies: 4
Views: 656
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 4th, 2009
Replies: 3
Views: 913
Posted By Comatose
FTP uses two ports (typically 20 and 21). One of those ports is meant to handle all of your commands. The other one, is meant to return data to you. If you receive an EOF on the command channel,...
Forum: Perl Apr 1st, 2009
Replies: 4
Views: 1,646
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,646
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 Mar 14th, 2009
Replies: 1
Views: 751
Posted By Comatose
probably similar to this: http://www.daniweb.com/forums/thread181408.html
Forum: Perl Mar 14th, 2009
Replies: 5
Views: 1,406
Posted By Comatose
to run the perl script from VB.NET, you need to shell to the system. I guess this works:
dim wsh
set wsh = createobject("WScript.Shell")
wsh.run "c:\perl\perl.exe somefile.pl", 0, 0 as for...
Forum: Perl Mar 6th, 2009
Replies: 1
Views: 457
Posted By Comatose
If your e-mail client handles HTML, you can simply enclose it in <b> </b> tags. You are really heavily reliant on the e-mail client for this.
Forum: Perl Mar 4th, 2009
Replies: 3
Views: 668
Posted By Comatose
I would make the .pl file, look for a temp file. Something like clpdata.dat or something, and have perl write the entry to the temp file. Then, I would have it scan the process list for other...
Forum: Perl Mar 2nd, 2009
Replies: 5
Views: 982
Posted By Comatose
qw (quote word) is used to generate a list of words. In the case above, where you use it as parameters to use module (which still wouldn't have worked, since you had a semicolon between use socket...
Forum: Perl Mar 2nd, 2009
Replies: 5
Views: 982
Posted By Comatose
Capitalize socket in your third line. use Socket, not use socket. Also, remove the qw line following it.
Forum: Perl Mar 1st, 2009
Replies: 2
Views: 1,261
Posted By Comatose
The problem is, the method you use to read from the file handle, slurps the file, and then iterates over each line by replacing $line with $_. If you really want to prove this, you can throw the...
Forum: Perl Feb 20th, 2009
Replies: 2
Views: 648
Posted By Comatose
Got +r perms on gettysburg.txt?
Forum: Perl Feb 17th, 2009
Replies: 19
Views: 1,325
Posted By Comatose
If it were windows itself, don't you think cmd.exe (which is a windows program) would support it? I would imagine so. According to MSDN (I was holding off on it, but will post it when I get home)...
Forum: Perl Feb 17th, 2009
Replies: 8
Views: 639
Posted By Comatose
You can mark this thread as solved :)
Forum: Perl Feb 16th, 2009
Replies: 8
Views: 639
Posted By Comatose
Oh For The Sake Of Pete:
#!/usr/bin/perl

$filepath = "./file.dat";

# Get Data From File Into Arrays
open (FH, "$filepath");
while (<FH>) {
($stamp, $part1, $part2) = split(/\s+/);...
Forum: Perl Feb 16th, 2009
Replies: 8
Views: 639
Posted By Comatose
How about attaching a portion of the file?
Forum: Perl Feb 12th, 2009
Replies: 8
Views: 789
Posted By Comatose
when you say "the remaining contents should be the same" do you mean, in file1 (ALL:FILE1) it should have just ALL:FILE1, AND the rest of the file (with the exception of ALL:FILE2, and ALL:FILE3,...
Forum: Perl Feb 11th, 2009
Replies: 19
Views: 1,325
Posted By Comatose
I trust O'Reilly significantly more than wikipedia. I also read on MSDN (will post when I get home) that it's the API calls and programs that do the translation, not NTFS Native.
Forum: Perl Feb 11th, 2009
Replies: 19
Views: 1,325
Posted By Comatose
Oddly enough, the above posted (with the suggestions to try cd / and cd /windows and cd "/documents and settings") was tested in windows XP SP1. I went to start... run, and typed in cmd. Once the...
Forum: Perl Feb 10th, 2009
Replies: 19
Views: 1,325
Posted By Comatose
I'm pretty sure windows does not support paths with / as the separator. Try this: cd / or cd /windowsand then try this cd \windows. What I'm guessing happens here, is Perl (and other languages that...
Forum: Perl Feb 10th, 2009
Replies: 4
Views: 664
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: 664
Posted By Comatose
#!/usr/bin/perl
system("cat '/something/something/something/darkside.txt'");
Forum: Perl Feb 5th, 2009
Replies: 7
Views: 628
Posted By Comatose
Forum: Perl Feb 5th, 2009
Replies: 9
Views: 1,595
Posted By Comatose
Try not to back to back post... it's bad etiquette (though sometimes necessary). The better alternative is to edit your post within the grace-period provided by the site.
Forum: Perl Feb 5th, 2009
Replies: 4
Views: 989
Posted By Comatose
Forum: Perl Feb 2nd, 2009
Replies: 7
Views: 628
Posted By Comatose
I do believe the code I gave you above would work just fine for what you are doing... instead of manually using push to push each item, you would do a for loop and push all of the items that are...
Forum: Perl Feb 2nd, 2009
Replies: 7
Views: 628
Posted By Comatose
There is probably a cleaner and easier way to do this, but if you include this sub in your perl file somewhere:
sub Compare_Items
{
($ref_cmplist, $ref_udata) = @_;

foreach $udata...
Forum: Perl Feb 1st, 2009
Replies: 3
Views: 334
Posted By Comatose
it's difficult to tell without the Perl script..... I personally would just use the PHP str_replace function (http://www.w3schools.com/PHP/func_string_str_replace.asp) and have it check for \'s in...
Forum: Perl Jan 30th, 2009
Replies: 3
Views: 430
Posted By Comatose
I'm not a big fan of just giving out code.... especially when I know it's for homework, but let me give you some detail.... once you do as KevinADC suggested, and get the DBI module installed, you...
Forum: Perl Jan 20th, 2009
Replies: 12
Solved: CSV File Issue
Views: 2,064
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: 982
Posted By Comatose
aha, maybe you should put the entire thing inside of the while loop ;)
Forum: Perl Jan 19th, 2009
Replies: 8
Views: 982
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 Jan 19th, 2009
Replies: 6
Views: 529
Posted By Comatose
Is this homework, or what is it that you want to accomplish?
Forum: Perl Jan 15th, 2009
Replies: 2
Views: 2,484
Posted By Comatose
This Page (http://www.dreamincode.net/code/snippet60.htm) might help.
Forum: Perl Jan 10th, 2009
Replies: 8
Views: 1,846
Posted By Comatose
use CGI;

chomp($name = param("name")); # // $name should have "foo" in it.
Forum: Perl Jan 6th, 2009
Replies: 4
Views: 543
Posted By Comatose
you're right, my bad too. I should have linked Here Instead (http://www.letmegooglethatforyou.com/?q=Parse%3A%3ARecDescent)
Forum: Perl Jan 6th, 2009
Replies: 4
Views: 543
Posted By Comatose
Right Here! (http://search.cpan.org/dist/Parse-RecDescent/lib/Parse/RecDescent.pm)
Forum: Perl Jan 4th, 2009
Replies: 3
Views: 1,160
Posted By Comatose
Basically, you need a specially module. http://search.cpan.org/~ingy/Inline-0.44/C/C.pod. This will let you put C++ code INLINE, that is, into the Perl file. This still doesn't let you call the C...
Forum: Perl Dec 29th, 2008
Replies: 5
Views: 1,468
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,468
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...
Showing results 1 to 40 of 146

 


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

©2003 - 2009 DaniWeb® LLC