Re: hit counter
I just wanted to note that the HTML in this was incorrect. img src myarray(i) .gif/img src should be 'img src=' myarray(i) '.gif' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Matching/replacing
LoneWolf wrote: I have to parse a big file and I do it line by line to keep stuff going correctly. I am at a point where I need it to go through and replace every with inches and ' with feet, IF item in front of it is a digit (0-9). I have this written in the script to parse it: while ($line = OLDFILE) { # $line = $line =~ /^\s*(.*)\s*\n$/; $line =~ s/^ //; $line =~ s/ $//; $line =~ s/\t/|/g; $line =~ s/\s+/ /mg; $line =~ s/^\s*//mg; $line =~ s/\s*$//mg; $line =~ s/\s*$//mg; ### The following lines mod the files to reflect inches and feet $line =~ s//in./mg; $line =~ s/'/ft./mg; print NEWFILE $line\n; help! With what? Is what you wrote not working? So far, you have told us about what you are trying to do, and the code you are using to achieve it. That is very good. What you haven't told us about is the results you get when you test it, or what your cause for dissatisfaction might be. Right offhand, I'd say that you have a lot of code for a very simple problem, but I can't see looking farther into it until you test it for yourself and let us know what results you get. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validate email chars
Can someone help me with validating email address chars? I think I have the back part ok. I just need to verify the front of the @ sign to have atleast 4 chars, start with a-Z allows \w\-\. ie: [EMAIL PROTECTED] $email ~ /^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/ thanks - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Matching/replacing
LoneWolf wrote: Here's the cleanup script as it stands right now. The problem with the file that comes out is leading white space after each | Then focus on the pipe. $_ =~ s/\s*\|\s*//g; Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
regex - validate email chars help
Can someone help me with validating email chars? I just need to verify the fron of the @ sign. Will the below ensure something like [EMAIL PROTECTED] $email ~ /^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/ thanks - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
GD-png error
I finally got GD installed on my machine , linux redhat 7.2 and perl 5.8.0 with libgd.so.2.0.12 I tried to write a simple GD script copied from the perldoc I get this error gd-png: fatal libpng error: zlib error gd-png error: setjmp returns error condition PNG This does not seem to be a perl error , any ideas Thanks Ram This is my script ( straight from perldoc GD ) #!/usr/bin/perl use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $white = $im-colorAllocate(255,255,255); $black = $im-colorAllocate(0,0,0); $red = $im-colorAllocate(255,0,0); $blue = $im-colorAllocate(0,0,255); # make the background transparent and interlaced $im-transparent($white); $im-interlaced('true'); # Put a black frame around the picture $im-rectangle(0,0,99,99,$black); # Draw a blue oval $im-arc(50,50,95,75,0,360,$blue); # And fill it with red $im-fill(50,50,$red); # make sure we are writing to a binary stream binmode STDOUT; # Convert the image to PNG and print it on standard output print $im-png; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question
Dillon, John wrote: I´m new with perl. I need to write a program that reads data out of a form sent via internet and is able to interpret the data. I have written the form in html. Is perl right for the other parts? How can I do this easyly? Are there any pre-witten programs or modules existing for that? ** PHP is what I use. www.php.net is easier than anything I've found on perl. See also database language on the slightly confusing www.mysql.com. PHP database query looks like this: $myquery = SELECT table.field FROM table WHERE table.field = '$variable'; I trust PHP doesn't force you to write those extraneous table identifiers in a query like this. Standard SQL should require the table name only in cases of ambiguity--where more than one table have a field of the same name. While this is off-topic re Perl, it's also a good idea to have an informative subject line, like: Parsing HTML form output: to use or not to use Perl? that is the question! No it wasn't. The question was somewhat vague, since it could be interpreted in a number of ways, but Perl is quite handy for reading data submitted through HTML forms. It also has modules available that can parse information from HTML tables from the source and translate into SQL. Perl even allows one to generate confusion and m,isery for oneself through the use of literals as variable names. With the Perl community, though, you can count on someone to say Don't do that. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: setting data in arays from a file
Ken Cole wrote: Hi ALL, I have GDGraph installed and is working well on a RH 7.3 box. Now what I need to do is write some perl code to read in some data from a file that gets stored in arrays like this is hardwired. $data = ([ [1st,2nd,3rd,4th,5th,6th,7th, 8th, 9th], [1,2,5,6,3, 1.5, -1,-3,-4], [ -4, -3,1,1, -3, -1.5, -2,-1, 0], [9,8,9, 8.4, 7.1, 7.5,8, 3,-3], [ 0.1, 0.0, -0.3, -0.4, 0.1, 0.5, 0.1, 0, 0.4], ]); The first line is the X axis labels and the others are data for a line graph that has four lines on it. My final will have 3 lines to graph. Can anyone help please. Ken Assume You have the data in CSV ( comma sepeated values ) file called $FILE use Tie::CSV_File; tie my @data, 'Tie::CSV_File',$FILE; # Now @data conatins the data in exactly the same format as u require Thats it , So simple Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: regex - validate email chars help
[EMAIL PROTECTED] wrote: Can someone help me with validating email chars? I just need to verify the fron of the @ sign. Will the below ensure something like [EMAIL PROTECTED] $email ~ /^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/ thanks I think you have the soln already In your script you could do something like this if( $email=~/^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/) { # Valid } else { # invalid } Bye Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question
Dillon, John wrote: Yea, well it's really HTML that's the problem. The question was whether perl was appropriate, not how to do it in perl. But, usefully, if there is anything in the perl documentation that is quite as easy and cross-referenced as the search box on www.php.net then I would like to find it. Okay, your issue seems to be about Perl documentation. I tend to agree. I find way too much rambling, and way too little indexing. That was not the subject of the OP, though. If you think that Perl documentation could use a better organizing and indexing system, then start a thread to advocate it. Just skip the comparisons, though, and focus on the issues as they relate to Perl. Maybe you could develop such an index, if you think it is so badly needed.. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: not on topic but relevant to list
Just dont use mail use a newsreader to use this group pointed at nntp.perl.org Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When is Perl 6 coming out?
Hi all, i am just curious -- is perl 6 coming with a compiler ? thanks, regards, KM On Wed, Nov 12, 2003 at 07:53:17PM -0800, Randal L. Schwartz wrote: Dan == Dan Anderson [EMAIL PROTECTED] writes: Dan That doesn't make me think very highly of O'Reilly if they /already/ Dan have a copy of a book on Perl 6 in stores. Quite the contrary, I'll suggest. The people who wrote the Perl 6 book are deeply involved in the core of creating Perl 6. It's meant to be a book of here's where we are at for those who are trying to follow along. I think the goal is to update it frequently. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Threading In List Replies [Re: QUESTION]
[This new thread concerning an issue raised in the question thread initiated with [EMAIL PROTECTED] was broken off by beginning a new message to eliminate references, then pasting in relevant material from the other thread.] Rob Dixon wrote: To others who have posted on this thread, I had so much trouble working out who was saying what to whom that I gave up. Why are all of the posts at the top level instead of beneath the items that they corresponded to? Thanks for the observation, Rob. This has been bugging me for some time. The problem here is that neither of the mailers used in the PHP/Perl feud makes good use of the Message-ID of the post they are responding to. The problem is not isolated, though. It seems the majority of mailers are bad in this regard. Of the 13, 139 posts in a mailbox used for this group, 13,139 had a Message-ID header line. That is very dependable. Unfortunately, only 5,582 had References: items, and only 1235 had Reply-To: lines. I doubt that the others all hand-modified their subject lines and hand-quoted the text, so I assume that there mailers are simply not good at linking posts. Folks, please examine your proof copies of the replies you send, use Full headers view. If you don't see any reference to the Message-ID of the post to which you are replying, look for a better mailer application. That tag is so reliable that it is insane to neglect it in a discussion group such as this. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: regex - validate email chars help
Thanks for the response. I think I picked up on the backslash \@ would be something that was off. I didn't use the \w in some of those areas because I didn't want the numbers or underscore. Anyway what is soln? -fw [EMAIL PROTECTED] wrote: Can someone help me with validating email chars? I just need to verify the fron of the @ sign. Will the below ensure something like [EMAIL PROTECTED] $email ~ /^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/ thanks I think you have the soln already In your script you could do something like this if( $email=~/^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/) { # Valid } else { # invalid } Bye Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When is Perl 6 coming out?
Dan Anderson wrote: It is far from completion, but a lot of progress has been made. My guess is beta in a year... but nobody really knows, and there is no schedule for it. The goal is to do it right, even if it means a very long development cycle. That doesn't make me think very highly of O'Reilly if they /already/ have a copy of a book on Perl 6 in stores. You object to the idea of hitting the ground running? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accesing hash of hashes
Ravi Malghan wrote: Hello: I am trying to create and access a multidimensional hash. For example the following works == $route {$routeDest} = $cost ; print $routeDest, Cost: $route{$routeDest}\n = But the following does not print the $route{$NODE}{$routeDest} == $route {$NODE}{$routeDest} = $cost; print $route on $NODE cost: $route{$NODE}{$routeDest}; == What am I doing wrong here? Probably running away from the challenge of understanding references. Until you take it on, you are SOL for multidimensional structures. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Threading In List Replies [Re: QUESTION]
Now that you explained all that, should I reply or reply all? ie - this message does a reply all as: To: R. Joseph Newton [EMAIL PROTECTED] CC: Beginners--Perl [EMAIL PROTECTED], Rob Dixon [EMAIL PROTECTED] Subj: Re: Threading In List Replies [Re: QUESTION] I did a reply all. Please let me know if this is correct. fw [This new thread concerning an issue raised in the question thread initiated with [EMAIL PROTECTED] was broken off by beginning a new message to eliminate references, then pasting in relevant material from the other thread.] Rob Dixon wrote: To others who have posted on this thread, I had so much trouble working out who was saying what to whom that I gave up. Why are all of the posts at the top level instead of beneath the items that they corresponded to? Thanks for the observation, Rob. This has been bugging me for some time. The problem here is that neither of the mailers used in the PHP/Perl feud makes good use of the Message-ID of the post they are responding to. The problem is not isolated, though. It seems the majority of mailers are bad in this regard. Of the 13, 139 posts in a mailbox used for this group, 13,139 had a Message-ID header line. That is very dependable. Unfortunately, only 5,582 had References: items, and only 1235 had Reply-To: lines. I doubt that the others all hand-modified their subject lines and hand-quoted the text, so I assume that there mailers are simply not good at linking posts. Folks, please examine your proof copies of the replies you send, use Full headers view. If you don't see any reference to the Message-ID of the post to which you are replying, look for a better mailer application. That tag is so reliable that it is insane to neglect it in a discussion group such as this. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem deleting record in a text file
[EMAIL PROTECTED] wrote: Hi all, I'm new to perl (that's why I'm here :-). ...and you are getting your first opbject lesson: use strict; use warnings; $tmp_file=users.tmp; open(TMPDAT, $tmp_file) || die (Could not open temporary file!); Note $tmp_file rename ($temp_file, $data_file) or die (Can't rename '$tmp_file' to '$data_file': $!\n); There is no $temp_file. Had you added the strict and warnings pragmas at the top of your file, you would have been amply warned about the typo. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!) - select???
quite interesting chunk of code - but what the hell does select does here? Yeah - I rtfm - but didn't understand it - maybe one could explain it in more simple words? Jane Kevin Old wrote: What I wanted to do was to make each number appear in sequence like you see in a countdown (or up, in this case) instead of all on the screen at once. Try this codeeither of these might be what you're looking for #!/usr/bin/perl # use warnings; use strict; print printing 1thru5 with buffering\n; select undef, undef, undef, 0.25 or print $_ for 1 .. 5; print \nflush forced\n; $|++; print printing 1thru5 without buffering\n; select undef, undef, undef, 0.25 or print $_ for 1 .. 5; print \nflush forced\n; Hope this helps, -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: GD-png error
Ramprasad A Padmanabhan wrote: I finally got GD installed on my machine , linux redhat 7.2 and perl 5.8.0 with libgd.so.2.0.12 I tried to write a simple GD script copied from the perldoc I get this error gd-png: fatal libpng error: zlib error gd-png error: setjmp returns error condition PNG This does not seem to be a perl error , any ideas Thanks Ram Sorry , dont bother. I just got a new version of zlib and libpng and recompiled GD now it works fine Thanks Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Fw: question
[EMAIL PROTECTED] wrote: On Wed, 12 Nov 2003 19:44:02 +, John Dillon wrote: whereas php started as a HTML manipulation language and is good for database interaction, for which arrays are important. I'd love to see examples on what Perl can't do compared to PHP. One of my biggest complaints about PHP is its inability to retreive multiple results sets from a single call. Sybase stored procedures and PHP don't interact very well. But in Perl, just code the loop that the PHP command hides from you and voila, multiple result sets. Chuck
answers to my yesterdays question
Hi, thanks for answering my yesterdays question in this good and friendly way - to all of you who answered. Matt -- NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService Jetzt kostenlos anmelden unter http://www.gmx.net +++ GMX - die erste Adresse für Mail, Message, More! +++ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: not on topic but relevant to list
Just dont use mail use a newsreader to use this group pointed at nntp.perl.org Ram Thanks what a excellent idea, all tho i fear it will not save me now. Does any one know of a good news reader i can install on my web-site? one written in Perl would be nice ;) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- fnord yes im a Concord Engineer, no it never flown! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: setting data in arays from a file
Cool, Thanks very much. Ken -Original Message- From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED] Sent: Thursday, 13 November 2003 5:45 PM To: Ken Cole Cc: [EMAIL PROTECTED] Subject: Re: setting data in arays from a file Ken Cole wrote: Hi ALL, I have GDGraph installed and is working well on a RH 7.3 box. Now what I need to do is write some perl code to read in some data from a file that gets stored in arrays like this is hardwired. $data = ([ [1st,2nd,3rd,4th,5th,6th,7th, 8th, 9th], [1,2,5,6,3, 1.5, -1,-3,-4], [ -4, -3,1,1, -3, -1.5, -2,-1, 0], [9,8,9, 8.4, 7.1, 7.5,8, 3,-3], [ 0.1, 0.0, -0.3, -0.4, 0.1, 0.5, 0.1, 0, 0.4], ]); The first line is the X axis labels and the others are data for a line graph that has four lines on it. My final will have 3 lines to graph. Can anyone help please. Ken Assume You have the data in CSV ( comma sepeated values ) file called $FILE use Tie::CSV_File; tie my @data, 'Tie::CSV_File',$FILE; # Now @data conatins the data in exactly the same format as u require Thats it , So simple Ram NETCORE SOLUTIONS *** Ph: +91 22 5662 8000 Fax: +91 22 5662 8134 MailServ and FlexiMail: Messaging Solutions: http://netcore.co.in Pragatee: Integrated Server-Software Suite: http://www.pragatee.com Emergic Freedom: Server-centric Computing: http://www.emergic.com BlogStreet: Blog Profiles and RSS Ecosystem: http://blogstreet.com Deeshaa: Rural Development: http://www.deeshaa.com Rajesh Jain's Weblog on Technology: http://www.emergic.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
invoking external programs
Hi I'm actually building a web interface to a news group server (INN). One of the feature is to allow a few users to create and delete newsgroups from the web. Basically, using CGI.pm, I retrieve the newsgroup's name, whether the user ask for a creation or a deletion of a newsgroup, and launch a few commands. Normally, from the shell, I would perform the following operations to create or remove a newsgroup (I will setuid the ctlinnd because ctlinnd needs to be executed as the news user): /usr/local/news/bin/ctlinnd pause modification of active file /usr/local/news/bin/ctlinnd rmgroup/newgroup name_of_the_newsgroup /usr/local/news/bin/ctlinnd reload active reload active file /usr/local/news/bin/ctlinnd go modification of active file If the server successfully performed the command, ctlinnd will exit with a status of zero and print the reply on standard input. If the server could not perform the command (for example, it was told to remove a newsgroup that does not exist), it will direct ctlinnd to exit with a status of one. It's not clear to me how I could retrieve the status code. I would also like to know whether the way I use system() is right or if there is a better way to do what I'm tryining to do. You will find below the script on which I'm working Have a nice day all Gaël - #!/usr/bin/perl use strict; use warnings; use CGI; $query = new CGI; $newsgroup_name = $query-param('newsgroup_name'); $action = $query-param('submit'); sub get_{ system `/usr/local/news/bin/ctlinnd pause modification of active file`; if ($action eq 'Add') { system `/usr/local/news/bin/ctlinnd newgroup $_[0]`; my $result = 1; } elsif ($action eq 'Remove') { system `/usr/local/news/bin/ctlinnd rmgroup $_[0]`; my $result = 2; } system `/usr/local/news/bin/ctlinnd reload active reload active file`; system `/usr/local/news/bin/ctlinnd go modification of active file`; } get_($newsgroup); print Content-Type: text/html\n\n; print html head\n; print titleManage newsgroups/title\n; print /head\n; print body\n; if ($result eq '1') { print The newsgroup has been added; } elsif ($result eq '2') { print The newsgroup has been removed; print /body /html\n;
remote telnet
My grreting I m developing a script that will send telnet commands to a telnet Server, I m getting to send all the commands but I never know if that was sucefull done or notI would like to know if it is possible to know if I can figure when my commads done was sucefull executed. Other problem is that when I send commands I would like to see the aswer of my commads on my screen where I m running my perl script... for example when I send dir..i want to see in my telnet script all the dirs listened in the remote telnet. I m working on it for longer and I do not know what to do :-( I thanks any help very much rogerio --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003
I forgot to send my code
Sorry I forgot to send my script code so it d make things easier to figure what I m doing sub cmdLSActivity { my $pwd = $FTP-Pwd(); $pwd =~ s|/|\\|g; my $pathViewDeliver = $dirViewServ . $pwd; $telnet-cmd(cleartool lsactivity -s -view $viewDesenv); print $telnet-getlines(all); # this command is not helping anything :-( } --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003
RE: Counting (easy!) - select???
Christiane Nerz wrote: Kevin Old wrote: ... select undef, undef, undef, 0.25 or print $_ for 1 .. 5; ... quite interesting chunk of code - but what the hell does select does here? Yeah - I rtfm - but didn't understand it - maybe one could explain it in more simple words? It's used in this case for sleeping for less than one second. The sleep() function only sleeps for a whole number of seconds. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validate email chars
Can someone help me with validating email address chars? I think I have the back part ok. I just need to verify the front of the @ sign to have atleast 4 chars, start with a-Z allows \w\-\. ie: [EMAIL PROTECTED] $email ~ /^[a-zA-Z][\w\-\.]{3,[EMAIL PROTECTED]/ If you know your e-mail addresses are of an exact form then ok, but otherwise do NOT try to validate email addresses with the above regex. E-mail addresses are an incredibly complex beast and just can't be done with something as simple as the above. I would suggest checking out Email::Valid for address validation, or at least pulling out the regex it contains (I believe gotten from the Mastering Regex book) and using that. Then if you want to make sure your address meets *your* standards check it specifically for those... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!) - select???
Bob Showalter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christiane Nerz wrote: Kevin Old wrote: ... select undef, undef, undef, 0.25 or print $_ for 1 .. 5; ... quite interesting chunk of code - but what the hell does select does here? Yeah - I rtfm - but didn't understand it - maybe one could explain it in more simple words? It's used in this case for sleeping for less than one second. The sleep() function only sleeps for a whole number of seconds. Not exactly a transparent piece of code though is it. Especially if your base system isn't Unix! /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: invoking external programs
On Nov 13, 2003, at 5:26 AM, [EMAIL PROTECTED] wrote: [snip - problem description] If the server successfully performed the command, ctlinnd will exit with a status of zero and print the reply on standard input. If the server could not perform the command (for example, it was told to remove a newsgroup that does not exist), it will direct ctlinnd to exit with a status of one. It's not clear to me how I could retrieve the status code. I would also like to know whether the way I use system() is right or if there is a better way to do what I'm tryining to do. I don't do a lot of shelling out, but the documentation for the system() call seems to explain how to get the return value pretty well. You can read that by entering: perldoc -f system Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: remote telnet
My grreting I m developing a script that will send telnet commands to a telnet Server, I m getting to send all the commands but I never know if that was sucefull done or notI would like to know if it is possible to know if I can figure when my commads done was sucefull executed. Other problem is that when I send commands I would like to see the aswer of my commads on my screen where I m running my perl script... for example when I send dir..i want to see in my telnet script all the dirs listened in the remote telnet. I m working on it for longer and I do not know what to do :-( I thanks any help very much Pasted code from second message... sub cmdLSActivity { my $pwd = $FTP-Pwd(); $pwd =~ s|/|\\|g; my $pathViewDeliver = $dirViewServ . $pwd; $telnet-cmd(cleartool lsactivity -s -view $viewDesenv); print $telnet-getlines(all); # this command is not helping anything :-( } You are using both a $FTP and a $telnet inside this sub, which we have no idea where they came from, which is probably not how the code should be laid out but that is for another discussion. Assuming your $telnet is a Net::Telnet object I don't believe you want to use the 'getlines' object method directly as that deals with the underlying object and an open file descriptor it is using in the session. To capture the output from 'cmd' I believe you should either store it directly to an array (as opposed to in void context) or store the return code to a scalar and pass a reference to the command using the 'output' parameter. So something like: my @output = $telnet-cmd(cleartool lsactivity -s -view $viewDesenv); -or- my @output; my $result = $telnet-cmd('String' = cleartool lsactivity -s -view $viewDesenv, 'Output' = [EMAIL PROTECTED]); Should re-read the documentation for Net::Telnet paying specific attention to the definition of 'cmd'... perldoc Net::Telnet Does this get it? http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!) - select???
On Thu, 2003-11-13 at 09:33, Rob Dixon wrote: Bob Showalter [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Christiane Nerz wrote: Kevin Old wrote: ... select undef, undef, undef, 0.25 or print $_ for 1 .. 5; ... quite interesting chunk of code - but what the hell does select does here? Yeah - I rtfm - but didn't understand it - maybe one could explain it in more simple words? It's used in this case for sleeping for less than one second. The sleep() function only sleeps for a whole number of seconds. Not exactly a transparent piece of code though is it. Especially if your base system isn't Unix! Yes, I agree, but technically it's not my code snippet. From whoever I learned the autoflushing technique from, they gave me this code snippet. Yeah, I was confused about the select statement, but the perldoc on select does have that same snippet for delaying 1/4 second. Oh well Kevin -- Kevin Old [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Version differences
Hello Guys, I Wanted to know what are the differences in version 5.005 and version v.5.8.0 of perl . please let me know where can I find this info thanks sachin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When is Perl 6 coming out?
Please don't top post... Hi all, i am just curious -- is perl 6 coming with a compiler ? This is a rather vague post, how do you really mean? Essentially it is just not that simple, which is why the book is a good resource for people to find out what Perl 6 is really all about, as it is about much more than just a language with an interpreter... Check out the links I provided in my other post for better information about Perl 6. Specifically the article archive, but read from the bottom up http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Error Message: Can't use an undefined value as a hash reference
Dan Anderson wrote: There are many references , what line number does it say is evil and which line below is that? Thanks for your help, I have put a -right here - in the code... } $SQL .= \n; } #-right here-- } $SQL .= );\n\n; return $SQL; Given that your error message indicates a problem with a hash ref, and that the compiler stopped at the end of a loop, I'd say the problem has something to do with mismatched braces. Unfortunately, your code is way too thick to be worth crawling through without context. Lets look at some of the factors that make this difficult to debug: This: my @options = @{ $hash{options} }; while ($_ = shift (@options)) { if ($_ =~ m/not null/i) { $SQL .= NOT NULL ; } ... else { $debugger-error(Option: $_ is not known. Assuming it's database specific and ignoring.); } } $SQL .= \n; } should be afunction of its own, with clearly named parameters. So should this: $SQL .= CREATE TABLE $table_name\n; $SQL .= (\n; while (my %hash = %{ shift (@columns) }) { $SQL .= $hash{name} ; if ($hash{type} =~ m/INT/i) { } #-right here-- } $SQL .= );\n\n; return $SQL; the enclosing block, although I can't say for sure that I picked the right ending brace for the start. That uncertainty is the whole point. There are many challenges in programming that are more worthy of your efforts than tracking braces. One of them is organizing functionality. while ($_ = shift (@temp)) { my $temp3 = { name = $_, So you are naming some that is temporary, huh? Gee, uh, well, that's nice to know. It would be even nicer to know what this temporary thing represents. Choose your variable names with more care. Programming should be about something. The identifiers you use should tell you what the code is about. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Version differences
Hello Guys, I Wanted to know what are the differences in version 5.005 and version v.5.8.0 of perl . please let me know where can I find this info perldoc perldelta Will in general tell you the significant changes in the version you are using compared to a previous significant version. perldoc perl Should provide you a list of the available delta's, reading through each should give you an idea, and maybe put you to sleep Those are pretty significant version differences... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting remote image sizes with image::size lwp
Matthew Galaher wrote: I am trying to get the width and height attributes of jpg's and gif's on a remote server. I have found Image::Size and LWP but am unable to put them together so that I can open an http path (e.g. http://wwwfoobar.com/dirname/dirname/dirname/images/111203.gif) and print out the image size. Any help would be appreciated including where I might go to read more on this. TIA My first attempt that failed: [snip--not yet relevant] Please show us the code and results when you: Test Image::Size in isolation, using a local image file of known properites. Include any error messages, the clearly marked lines they refer to, and a description of what happens or doesn't when you run it. Make sure you have: use strict; use warnings; at the top of your script. People are usually not willing to spend much time on you problem until you do. Test LWP in isolation, getting a known plain text file and reading out the contents. Include any error messages, the clearly marked lines they refer to, and a description of what happens or doesn't when you run it. Make sure you have: use strict; use warnings; at the top of your script. People are usually not willing to spend much time on you problem until you do. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Counting (easy!)
In Perl that is usually written as: for $count ( 1 .. 5 ) { print $count\n; } Or even easier: for(1..5) { print; } Or if you nee the newline: for(1..5) { print $_\n; } HTH DMuey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validate email chars
On Wed, 12 Nov 2003 23:05:53 -0800, perl wrote: Can someone help me with validating email address chars? This is a FAQ: perldoc -q valid mail -- Tore Aursand [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can't not locate object method isadmin via package Noc1
Hello all, I just added a new method called isadmin to existing and working module Noc1.pm And use this new added method in my index.html like this use Noc1; my $noc = new noc1; my public = noc-ispublic(); my $admin = noc-isadmin(); if ($admin) { blah blah blah} When i tried to access index.html i got the error msg... can't locate object method isadmin via package 'Noc1 at .../index.html line 21 Do you know what is the problem here ? Everything works fine with Noc1.pm and index.html until i add my new method isadmin in. thanks for your help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When is Perl 6 coming out?
You object to the idea of hitting the ground running? No...actually I replied to another poster on this matter. Sometimes computer books come out based on an Alpha or Beta version -- which is nice unless there have been significant changes, in which case it can be a confusing waste of money. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When is Perl 6 coming out?
km [EMAIL PROTECTED] asked: i am just curious -- is perl 6 coming with a compiler ? That depends on your definition of compiler. It certainly has a compiler that creates byte code, just as all of the current Perl versions. I don't know wether it will have a compiler like PerlEx bundled. What I know is that Perl 6 will have a cleaner separation of compiler and virtual machine. In fact, Perl 6 and its virtual machine Parrot are developed by different teams. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: invoking external programs
Hi, [EMAIL PROTECTED] [EMAIL PROTECTED] asked: I'm actually building a web interface to a news group server (INN). One of the feature is to allow a few users to create and delete newsgroups from the web. Hopefully only for your local news hierarchy ;-) Normally, from the shell, I would perform the following operations to create or remove a newsgroup (I will setuid the ctlinnd because ctlinnd needs to be executed as the news user): That is not the best possible solution. The best would doubtless be to set up a small tcp service that will run these commands on your behalf as the news user. The next best alternative would be to use sudo to allow your web server user to run the required commands as the proper user. /usr/local/news/bin/ctlinnd pause modification of active file /usr/local/news/bin/ctlinnd rmgroup/newgroup name_of_the_newsgroup /usr/local/news/bin/ctlinnd reload active reload active file /usr/local/news/bin/ctlinnd go modification of active file How long will those commands take to execute? Bear in mind that users as a species are dumb and that sh*t will happen, so you might want to consider that a user could hit the stop button while these jobs are still running. The web server will kill your CGI program and that will certainly also kill a spawned ctlinnd. If the server successfully performed the command, ctlinnd will exit with a status of zero and print the reply on standard input. [...] It's not clear to me how I could retrieve the status code. I would also like to know whether the way I use system() is right or if there is a better way to do what I'm tryining to do. I would say that system seems to be suited best to the task at hand. Not only does it allow you to read the status code on completion, but you can also check for crashes of the called program. from perldoc -f system: You can check all the failure possibilities by inspecting $? like this: $exit_value = $? 8; $signal_num = $? 127; $dumped_core = $? 128; [...] #!/usr/bin/perl use strict; use warnings; use CGI; # one I find quite useful for CGI development use CGI::Carp qw(fatalsToBrowser); HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can't not locate object method isadmin via package Noc1
I just added a new method called isadmin to existing and working module Noc1.pm Did you create Noc1 ??? And use this new added method in my index.html like this index.html ??? Hows' that work? use Noc1; my $noc = new noc1; my public = noc-ispublic(); ^^ ^^^ Do you mean $public and $noc ?? my $admin = noc-isadmin(); ^^^ $noc again?? if ($admin) { blah blah blah} When i tried to access index.html i got the error msg... can't locate object method isadmin via package 'Noc1 at .../index.html line 21 Do you know what is the problem here ? Did you make it exportable? I sit really in there just like that? How about some backgound on Noc1.pm and some code from it to show how it's used Everything works fine with Noc1.pm and index.html until i add my new method isadmin in. thanks for your help HTH DMuey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl Equavlent
Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl or is there function in perl called ceil ?? thx's -- MikemickaloBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Quality Web Hosting http://www.justlightening.net MSN: [EMAIL PROTECTED] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Starting Perl
I name my Perl scripts on my FreeBSD box something.pl because I'm the first (and so far only, but not for long) user of a Unix-y system in an all-Windows shop, and I don't want my colleagues to be confused. Quizzicality cuts both ways... =) -Chris -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 8:55 PM To: [EMAIL PROTECTED] Subject: Re: Starting Perl Rob == Rob Dixon [EMAIL PROTECTED] writes: Rob Perl programs conventionally go in *.pl files. No. Only on broken architectures that demand it (read: windows). On Unix, Perl programs have no extension, any more than cat has an extension. Why should the user care what the implementation language is? If you name your Perl program something.pl on a Unix machine, I shall continue to look at you quizzically until either you or I leave the room. :) Rob Perl modules are in *.pm. Yes, this is enforced by Perl. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Perl Equavlent
Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. or is there function in perl called ceil ?? Yes, in the POSIX module. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Error Message: Can't use an undefined value as a hash reference
R. Joseph Newton wrote: There are many references , what line number does it say is evil and which line below is that? Thanks for your help, I have put a -right here - in the code... } $SQL .= \n; } #-right here-- } $SQL .= );\n\n; return $SQL; Given that your error message indicates a problem with a hash ref, and that the compiler stopped at the end of a loop, I'd say the problem has something to do with mismatched braces. Unfortunately, your code is way too thick to be worth crawling through without context. Lets look at some of the factors that make this difficult to debug: This: my @options = @{ $hash{options} }; while ($_ = shift (@options)) { if ($_ =~ m/not null/i) { $SQL .= NOT NULL ; } ... else { $debugger-error(Option: $_ is not known. Assuming it's database specific and ignoring.); } } $SQL .= \n; } should be afunction of its own, with clearly named parameters. So should this: $SQL .= CREATE TABLE $table_name\n; $SQL .= (\n; while (my %hash = %{ shift (@columns) }) { $SQL .= $hash{name} ; if ($hash{type} =~ m/INT/i) { } #-right here-- } $SQL .= );\n\n; return $SQL; the enclosing block, although I can't say for sure that I picked the right ending brace for the start. That uncertainty is the whole point. There are many challenges in programming that are more worthy of your efforts than tracking braces. One of them is organizing functionality. while ($_ = shift (@temp)) { my $temp3 = { name = $_, So you are naming some that is temporary, huh? Gee, uh, well, that's nice to know. It would be even nicer to know what this temporary thing represents. Choose your variable names with more care. Programming should be about something. The identifiers you use should tell you what the code is about. I agree with you completely Joseph, but I'd be grateful for just proper indentation and whitespace. It's impossible to write code layed out like this without some trial-and-error placement of block terminators. I started to lay out the code to find the bug but gave up after about five minutes. In the absence of any specific guidelines you should aim for what is layed out in perldoc perlstyle People will forgive even major deviations form this standard, but the above code may as well be written on a single line. Perhaps there should be a 'Darwin Awards' for programming style? Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. ceil() is often presented with a sister function called floor(). That would be the same as Perl's int(). James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: When is Perl 6 coming out?
Hi all, i am just curious -- is perl 6 coming with a compiler ? thanks, regards, KM Yup, and from what somebody else posted it looks to be sweet: http://www.parrotcode.org/ -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!) - select???
Kevin Old wrote: On Thu, 2003-11-13 at 09:33, Rob Dixon wrote: Bob Showalter [EMAIL PROTECTED] wrote in message Christiane Nerz wrote: Kevin Old wrote: ... select undef, undef, undef, 0.25 or print $_ for 1 .. 5; ... quite interesting chunk of code - but what the hell does select does here? Yeah - I rtfm - but didn't understand it - maybe one could explain it in more simple words? It's used in this case for sleeping for less than one second. The sleep() function only sleeps for a whole number of seconds. Not exactly a transparent piece of code though is it. Especially if your base system isn't Unix! Yes, I agree, but technically it's not my code snippet. From whoever I learned the autoflushing technique from, they gave me this code snippet. Yeah, I was confused about the select statement, but the perldoc on select does have that same snippet for delaying 1/4 second. Don't worry Kevin, I wasn't getting at you! Your example is indeed straight from perldoc -f select but I was trying to say that it was so obscure it ought to be wrapped within a subroutine, something like # Do a high-resolution sleep using 'select' # sub sleep_hires { select(undef, undef, undef, shift); } Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, James Edward Gray II said: On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. ceil() is often presented with a sister function called floor(). That would be the same as Perl's int(). No, int() is neither exactly like ceil() or floor(). All int() does is truncate the number to an integer. If you have 2.3, you get 2. If you have 2.9, you get 2. If you have -2.3, you get -2. If you have -2.9, you get -2. If you were to write int() as a function of ceil() and/or floor(), you'd have to say: sub int { my $x = shift; $x 0 ? floor($x) : ceil($x); } -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ stu what does y/// stand for? tenderpuss why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
James Edward Gray II wrote: On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. ceil() is often presented with a sister function called floor(). That would be the same as Perl's int(). Thanks James. I'm being deliberately lazy here. 'floor' 'ceil' and 'int' have very particular specification in C in terms of whether they return an integer or a float. (Even in Perl, 3.0 is different from 3). Also they may round towards zero or negative infinity. For example, func(-3.5) may be -3, -4, -3.0 or -4.0. Anyone care to elaborate? Rob BTW, I can't stomach 'foo' or 'bar'. It makes me nauseous just to type them. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, 2003, at 10:01 AM, Jeff 'japhy' Pinyan wrote: No, int() is neither exactly like ceil() or floor(). All int() does is truncate the number to an integer. If you have 2.3, you get 2. If you have 2.9, you get 2. If you have -2.3, you get -2. If you have -2.9, you get -2. If you were to write int() as a function of ceil() and/or floor(), you'd have to say: sub int { my $x = shift; $x 0 ? floor($x) : ceil($x); } You're right. I was only thinking of positive numbers. My bad. Sorry. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
Dan Muey wrote: In Perl that is usually written as: for $count ( 1 .. 5 ) { print $count\n; } Or even easier: for(1..5) { print; } Or if you nee the newline: for(1..5) { print $_\n; } If we're competing, then there's print for 1..5 ;) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
Hi, So if I use the int() this will provide the same results as this ceil() function does... ?? thx's -- MikemickaloBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Quality Web Hosting http://www.justlightening.net MSN: [EMAIL PROTECTED] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= James Edward Gray II wrote: On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. ceil() is often presented with a sister function called floor(). That would be the same as Perl's int(). James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Counting (easy!)
On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote: In Perl that is usually written as: for $count ( 1 .. 5 ) { print $count\n; } Or even easier: for(1..5) { print; } Or _even_ easier; print 1..5; Hah! :-) -- Tore Aursand [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, 2003, at 10:17 AM, Mike Blezien wrote: So if I use the int() this will provide the same results as this ceil() function does... ?? No, it's not the same. See the chart earlier in this thread. Sorry for confusing the issue. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Version differences
On Thu, 13 Nov 2003 20:15:18 +0530, Sachin Mathur wrote: I Wanted to know what are the differences in version 5.005 and version v.5.8.0 of perl Check out perldelta for each version. -- Tore Aursand [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DBI MYSQL
By replacing the comma with a colon I was able connect to the database; it now looks like I have a permission problem where the user on computer B has no permission to reload the data on computer A. I was also able to login at the command prompt with the same error. My error was : ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) I will check in to this, I am sure I am missing a grant somewhere ! Thanks for everybody's help !!! // Larry -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 3:59 PM To: Tore Aursand; [EMAIL PROTECTED] Subject: RE: DBI MYSQL $dsn = DBI:mysql:webmaster,blackhole; This comma still throws me. Try DBI:mysql:webmaster:blackhole Also if you do this from the command line what happens after you put in the password you have in your script? $ mysql -u yourusernamehere -p -h blackhole webmaster What Tore said is true! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting Perl
On Thursday, Nov 13, 2003, at 07:49 US/Pacific, McMahon, Chris wrote: [..] I name my Perl scripts on my FreeBSD box something.pl because I'm the first (and so far only, but not for long) user of a Unix-y system in an all-Windows shop, and I don't want my colleagues to be confused. Quizzicality cuts both ways... =) -Chris [..] You might want to be a bit more Culturally Sensitive to the 'old guys', since, well, technically TLA's ( Three Letter Acronymns ) should be Three Letters Long. Once upon a time, a long long time ago, *.pl was the official designatore for a 'perl library', then the Perl Module suffix *.pm came into being to help ease folks from 'require foo.pl;' across to 'use foo;' so technically *.pl was actually taken, and should not have been used, since it a. had history b. is not three letters long hence if you wish to migrate a TLA model you should adopt the Orthodoxy of *.plx for perl executable. Alternatively you might get freaky and notice that in the Unixy World, BSD or otherwise, that there is no need to put 'extensions' on executables, one merely flips the executable bit on the code, and in the dark leaves the execution to the executioner. Helping your professional peers transition into the realm of BSDisms is a laudable goal, but you might want to be a bit more up front with them about the actual options open to them. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl memory utilization question...
I am an SA for several HP-UX systems. Recently a user had a problem running a Perl job and he indicated that it would die at about 1GB. Now, I believe that the HP-UX 11i kernel parameter 'maxdsiz' is the limit he is running into here, but I am not entirely sure. The question I really have is if this is indeed the parameter, it is limited to slightly under 4GB and the user needs approximately 5GB. So, can Perl use 64bit memory, which has an insanely huge limit so this user can run this job? Any feedback is most appreciated. Thanks. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
Hi, so I guess my question is, if I want to accomplish the same results as this ceil how would that be accomplished in Perl ?? thx's -- MikemickaloBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Quality Web Hosting http://www.justlightening.net MSN: [EMAIL PROTECTED] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Jeff 'japhy' Pinyan wrote: On Nov 13, James Edward Gray II said: On Nov 13, 2003, at 9:50 AM, Bob Showalter wrote: Mike Blezien wrote: Hi, Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl No. int() simply drops the fractional part. ceil() is often presented with a sister function called floor(). That would be the same as Perl's int(). No, int() is neither exactly like ceil() or floor(). All int() does is truncate the number to an integer. If you have 2.3, you get 2. If you have 2.9, you get 2. If you have -2.3, you get -2. If you have -2.9, you get -2. If you were to write int() as a function of ceil() and/or floor(), you'd have to say: sub int { my $x = shift; $x 0 ? floor($x) : ceil($x); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, 2003, at 10:38 AM, Mike Blezien wrote: Hi, so I guess my question is, if I want to accomplish the same results as this ceil how would that be accomplished in Perl ?? Does this one-liner get you started? perl -e 'use POSIX qw(ceil); print ceil(2.3), \n;' James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
Yes, this did the trick exactly :) thanks for your help -- MikemickaloBlezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Quality Web Hosting http://www.justlightening.net MSN: [EMAIL PROTECTED] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= James Edward Gray II wrote: On Nov 13, 2003, at 10:38 AM, Mike Blezien wrote: Hi, so I guess my question is, if I want to accomplish the same results as this ceil how would that be accomplished in Perl ?? Does this one-liner get you started? perl -e 'use POSIX qw(ceil); print ceil(2.3), \n;' James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting Perl
On Wed, Nov 12, 2003 at 07:55:24PM -0800, Randal L. Schwartz wrote: Rob Perl programs conventionally go in *.pl files. No. Only on broken architectures that demand it (read: windows). On Unix, Perl programs have no extension, any more than cat has an extension. Why should the user care what the implementation language is? If you name your Perl program something.pl on a Unix machine, I shall continue to look at you quizzically until either you or I leave the room. :) What kind of naming structure would you suggest for people who just want to use extensions for organizational purposes? -- chuk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
On Nov 13, 2003, at 11:38 AM, Mike Blezien wrote: Hi, so I guess my question is, if I want to accomplish the same results as this ceil how would that be accomplished in Perl ?? use POSIX qw/ceil/; $float = '1.9'; print ceil($float); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DBI MYSQL
By replacing the comma with a colon I was able connect to the database; it now looks like I have a permission problem where Cool, I'm glad that worked! the user on computer B has no permission to reload the data on computer A. I was also able to login at the command prompt with the same error. My error was : ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) I will check in to this, I am sure I am missing a grant somewhere ! Sounds like it, but at least you have it narrowed down eh? Cool HAGO, DMuey Thanks for everybody's help !!! // Larry -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 3:59 PM To: Tore Aursand; [EMAIL PROTECTED] Subject: RE: DBI MYSQL $dsn = DBI:mysql:webmaster,blackhole; This comma still throws me. Try DBI:mysql:webmaster:blackhole Also if you do this from the command line what happens after you put in the password you have in your script? $ mysql -u yourusernamehere -p -h blackhole webmaster What Tore said is true! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting Perl
On Thursday, Nov 13, 2003, at 09:32 US/Pacific, Chuk Goodin wrote: [..] What kind of naming structure would you suggest for people who just want to use extensions for organizational purposes? [..] when you say for 'organizational purposes' do you mean in terms of tracking the 'source code' in a source code control system? Or do you mean tracking named applications Allow me to illustrate my point, there is the compiled binary executable 'head' that happens to have no extension. But one of the small oopsies of installing the LWP onto a Mac OSX box was that the file system is 'case insensitive' so HEAD - the perl code stepped on 'head' the binary. So I had two choices, a. get the c-code source for 'head' and recompile b. whack in the perl code alternative for it Ok, so I also liked some of the SYSV arguments that can be used with 'head' the binary, that are not in the BSD variant, so I hacked the perl code to do what I wanted rather than the standard BSD release version. At which point we get to the core problem, how to manage the name space problem associated with wanting to use 'code' that will be found in the environmental variable PATH so that one does not have to type out the fully qualified path to the executable at the command line One solution is the /opt/myPackage/bin approach in which one will install all of their 'applications' inside of their own package name space on the file system under /opt per the POSIX standard. This is an approach that the Fink Folks like. Yes, if one wanted to have 'head.plx' as the lwp link to the lwp-request code that would check to see how it was called to set default options, then one would have to hack the actual lwp-request code to clean that up... And that gets us where in all of this??? So the real question is Which Organizational Process ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
copying a multidimensional array
Hi: whatz the best way to copy an multidimensional array onto another. I have never used something like clone, just want to know whatz the easiest route. Thanks Ravi __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Equavlent
Mike Blezien wrote: Ran accross a function called ceil and from the information I got on this: ceil() [Stands for ceiling], it just rounds a float value up.. so ceil(4.7) == ceil(4.1342) == 5 would this be the same as using int function in perl or is there function in perl called ceil ?? The bottom line to all of this is that your use of C functions in Perl depends on - The proper interpretation of the C library standard by the implementor of your Perl installation - Your understanding of that standard If it matters at all, then supply all test cases under which your installation should perform. If it doesn't matter then, hey .. it'll do something that don't crash. I really hope this helps. Rob English (Or are we getting too close to the 'Eastern' thread again?) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl memory utilization question...
On Thursday, Nov 13, 2003, at 08:40 US/Pacific, NIPP, SCOTT V (SBCSI) wrote: I am an SA for several HP-UX systems. Recently a user had a problem running a Perl job and he indicated that it would die at about 1GB. Now, I believe that the HP-UX 11i kernel parameter 'maxdsiz' is the limit he is running into here, but I am not entirely sure. The question I really have is if this is indeed the parameter, it is limited to slightly under 4GB and the user needs approximately 5GB. So, can Perl use 64bit memory, which has an insanely huge limit so this user can run this job? Any feedback is most appreciated. Thanks. p0: we'll skip of the 'why that' question, since if memory is a part of the problem, he might want to reconsider the option of porting to a tighter memory model code such as c89/c99 to begin with... p1: when you do 'perl -V' there is an option for how the version of perl you are using was built. a part of the challenge is whether your underlying c-compiler will actually support building a 64-bit verions: cf http://www.xav.com/perl/lib/Pod/perldelta.html#64bit%20support so you will need to check that it was built with -Duse64bitint That having been said, perl can only do what the underlying OS will allow it to do, and how the actual perl executable was built to do. p2: as an illustration, I ran into wakyNeff in perl code that formerly worked, but, well, when I hauled it over to a box that had a file system that allowed me to make files larger than 2gigabytes, the code 'freaked'. So I went back and rebuilt the actual /usr/bin/perl code with the USE_LARGE_FILES so that it would be able to detect and correctly return on if ( -f $file )... when $file happened to be a file over 2gigabytes. The problem was not in the 'perl text' passed to /usr/bin/perl, but in the actual /usr/bin/perl executable itself. HTH. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: copying a multidimensional array
On Thu, Nov 13, 2003 at 10:06:19AM -0800, Ravi Malghan wrote: Hi: whatz the best way to copy an multidimensional array onto another. I have never used something like clone, just want to know whatz the easiest route. Storable::dclone() is probably the easiest: use Storable qw(dclone); my @x = ([0,1,2], [3,4,5]); # multidimensional array my @y = @x; # shallow copy my @z = @{ dclone([EMAIL PROTECTED]) }; # deep copy require Data::Dumper; print Data::Dumper-Dump( [\(@x, @y, @z)], [qw(*x *y *z)] ); -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting Perl
What kind of naming structure would you suggest for people who just want to use extensions for organizational purposes? when you say for 'organizational purposes' do you mean in terms of tracking the 'source code' in a source code control system? Or do you mean tracking named applications Sort of both, but more of the former. Basically, if I've got a directory sitting there with three or four different types of files in it, I'd like to know which ones are perl (and I can just open them up in vi and fix them) and which ones aren't (and I'll have to find the source somewhere if I need to fix them). Right now I use .pl for that. how to manage the name space problem associated with wanting to use 'code' that will be found in the environmental variable PATH so that one does not have to type out the fully qualified path to the executable at the command line One solution is the /opt/myPackage/bin approach in which one will install all of their 'applications' inside of their own package name space on the file system under /opt per the POSIX standard. This is an approach that the Fink Folks like. That seems pretty extreme for my needs. So the real question is Which Organizational Process Calling it a process is probably going too far. -- chuk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
Tore Aursand wrote: On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote: In Perl that is usually written as: for $count ( 1 .. 5 ) { print $count\n; } Or even easier: for(1..5) { print; } Or _even_ easier; print 1..5; For the subscribers who don't already know, what are the differences between my print for 1..5 and Tore's print 1..5 ? (Deep magic here!) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: not on topic but relevant to list
--On Wednesday, November 12, 2003 6:25 PM -0500 Casey West [EMAIL PROTECTED] wrote: It was Wednesday, November 12, 2003 when [EMAIL PROTECTED] took the soap box, saying: : hum could we not get a nice topic prefix added to the list? : it would make it a lot easy to make mail filters that could kill : all mail going to this address, not from the list.? No, we won't be doing that. Use the headers. Perhaps Delivered-To could help. How about the RFC 2919 headers that this list thoughtfully includes (though it misses one...). The following are included in every email from this list: List-Post: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] Daniel T. Staal --- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please help!
Hi- I'm an absolute beginner to Perl. I need to write a script that will take tables from a SQL server database, somehow get them into HTML format, and automatically generate an email to a list of users containing the info I just converted into HTML. All I can seem to find online is generating automatic emails from web forms. Can anyone give me some ideas?? I would appreciate it. I just started a new job and don't want to mess this up.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
trying again....
I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help!
On Nov 13, 2003, at 1:14 PM, [EMAIL PROTECTED] wrote: Hi- I'm an absolute beginner to Perl. I need to write a script that will take tables from a SQL server database, somehow get them into HTML format, and automatically generate an email to a list of users containing the info I just converted into HTML. All I can seem to find online is generating automatic emails from web forms. Can anyone give me some ideas?? I would appreciate it. I just started a new job and don't want to mess this up.. No offense intended, but if you are an absolute beginner, you're not exactly starting at the bottom, are you? We do you know? SQL, HTML, other languages? What exactly are you wanting, since you've already told us your skills aren't up to this project yet? Do you want to know if we'll write it for you or simply tell you where to start? My suggestion would be to start learning some Perl. Learning Perl is a common book to start with. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: trying again....
On Nov 13, 2003, at 1:23 PM, [EMAIL PROTECTED] wrote: I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? Perl can definitely do anything you said, including generating e-mail, yes. The are good modules for this, but that is not where you should begin, I think. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Source Code Control and Naming ThingiePoo was Re: Starting Perl
On Thursday, Nov 13, 2003, at 10:34 US/Pacific, Chuk Goodin wrote: [..] Basically, if I've got a directory sitting there with three or four different types of files in it, I'd like to know which ones are perl (and I can just open them up in vi and fix them) and which ones aren't (and I'll have to find the source somewhere if I need to fix them). Right now I use .pl for that. [..] Calling it a process is probably going too far. [..] You will forgive me if I whine a bit here, first at the Unpleasant irony of 'organizational process' as, well, yes, good quip. So let us step back and look at the 'root cause problem' so I want to just 'fix it on the fly' and yes, foo.pl as an editable text file will allow you simply open it with a text editor and WHACK a fix in. Unlike RealCode[tm] that has to be 'compiled' and installed. But why not treat your 'perl code' like as if it were RealCode[tm]? The code that makes it out onto the 'production machines' should be treated with some respect, irregardless of the language used, eh no? So why not start an 'organizational process' that begins with the this is our source code control system this is our build and release mechanism this is our installation mechanism that type of process does not discriminate on the basis of origins of source code. It likewise does not really care much about the 'extensions' that may be 'fashionable', no? Likewise it will help 'repeatability' and 'recoverability' in the long run, since if you have your code under some form of source code control, you can keep track of what got modified by whom, and perchance why. You can also keep track of what is 'installed' - whether one is using the RPM information, or the Solaris Package Info, etc, etc, etc. There is nothing quite as ugly as finding out that the only copy of the foo code just got stomped on by an 'older version' because, well, it was simpler to 'edit on the fly' the foo code, because, well, it is just perl and it is editable, and it's not like it was you know c-code or a RealCoding[tm] language... If you back up your source tree, and cache it off site, then one has the 'golden master' from which all can be rebuilt to the current standard. In like manner, while at present you may not see the usefulness of the POSIX style approach of /opt, you may find that it will become useful for a variety of reasons that lead to the creation and adoption of the 'standard'. If you start this process early on, you CAN actually save yourself much grief in the long run. ESPECIALLY when you start noticing that there are common blocks of code in a bunch of *.pl files that could be shifted into a common Our::Foo::Stuff perl module, and of course at that point you want to be building it out with h2xs, so that you can make the simpler process of having a Makefile created from the Makefile.PL that will simplify installing the Perl Module in the canonical CPAN style location so that all of the 'executables' that are going to be delivered with it do not have to go gerryMeandering around wondering where the Module got installed and can all start out with that simple elegance of #!/usr/bin/perl -w use strict; use Our::Foo::Stuff; #-- # this code does. Today it is one or two scripts, tomorrow you are up to your yaba-Hoo-Hoo-Hoo trying to find all n-gagillion of them that all have the same common defect because everyone opted to just fix it on the fly, and they cut and pasted from one to the next, and there are cats and dogs living together But by going back to the 'source' you get to edit in one fix, crank the build and release handle that punks out one more installable, and you haul it around, just like as if it were RealCode[tm] and have some knowledge about what is installed where and that your life is so much simpler. ciao drieux --- ps: ok, if you name is Neo, going back to the Source may make you twitch, but it is the right thing to do, just get in touch with your inner, uh, correctness... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: trying again....
--howdy: --not sure i follow, but i have a few questions for --you: * you want to connect to the database and do, what, exactly? show the data in html? * you have a list of people in the database, perhaps, that you want to email? what platform? not that it really matters ... windows, linux, unix? --from what i can see (and from what i've done), --you'll need * drivers to connect to your database (perl / cgi) * some SQL saavy * some HTML saavy -X -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists?
RE: trying again....
Check out Mail::Mailer ... I use that for 99% of my scripts that need email support.. --- Jason H. Frisvold Backbone Engineering Supervisor Engineering Dept. Penteledata RedHat Engineer - RHCE # 807302349405893 [EMAIL PROTECTED] --- I love deadlines. I especially like the whooshing sound they make as they go flying by. -- Douglas Adams [1952-2001] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 2:23 PM To: [EMAIL PROTECTED] Subject: trying again I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Threading In List Replies [Re: QUESTION]
--On Thursday, November 13, 2003 12:35 AM -0800 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Now that you explained all that, should I reply or reply all? ie - this message does a reply all as: To: R. Joseph Newton [EMAIL PROTECTED] CC: Beginners--Perl [EMAIL PROTECTED], Rob Dixon [EMAIL PROTECTED] Now that is a completely separate question. An email client that generates a 'In-Reply-To' header for one will most likely generate it for the other. To actually answer your question: who do you want to send the email to? If you want to send it back to the list (usually best) you need to make sure that one of the addresses you are sending to is [EMAIL PROTECTED] This list does not munge the Reply-To header (you can argue about if that is right...), so a 'reply' will not, by default, send to the list[1]. If you want to take a discussion offlist you only want to email the people involved, usually the person who wrote the email you are replying to, and then 'reply' is all you need. Personally I just trim them all off and put [EMAIL PROTECTED] in the 'To:' field. Daniel T. Staal [1] Unless the author, like me, changes their 'Reply-To' address to this list themselves. Note that that isn't competely foolproof: some clients automatically reply to the 'From' address, which I leave alone. (That behavior is just wrong, but anyway...) --- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dealing with Email and Perl was Re: trying again....
On Thursday, Nov 13, 2003, at 11:23 US/Pacific, [EMAIL PROTECTED] wrote: I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? you will want to become good friends with the CPAN as it is a great source for modules. The question is not whether it can do email, but how much of it do you want it to do for you, with you, cf http://search.cpan.org/modlist/Mail_and_Usenet_News/Mail Some of what I have for demonstration kvetching is up at http://www.wetware.com/drieux/pbl/Other/email/ Personally I like the Mail::Mailer stuff that comes with Overmeer's MailTools-1.60 http://search.cpan.org/~markov/MailTools-1.60/Mail/Mailer.pm HTH. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help!
I'm an absolute beginner to Perl. I need to write a script that will take tables from a SQL server database, somehow get them into HTML format, and automatically generate an email to a list of users containing the info I just converted into HTML. All I can seem to find online is generating automatic emails from web forms. Can anyone give me some ideas?? I would appreciate it. I just started a new job and don't want to mess this up.. Hey Sarah7281 You have a pretty ambitious set of needs. You'll probably have to break it down into pieces and go after one thing at a time. The e-mail thing is probably the easiest. Maybe it would help if you told us what programming experience you have? There are ready-built modules out there that just require the customization of a few variables up front. That's what sucked me into Perl ages ago. Unfortunately, I never learned much more than that. Until I bought Perl for Web Site Management, by John Callender, [O'Reilly]. It has chapters that would be helpful for you, and a nice easing into Perl in the opening chapters. Sure filled in a lot of the blanks for me. It doesn't go through Perl/SQL, though. Other people on this list have and will provide more explicit examples, but I'd recommend a book so you can get some more foundation in Perl and ask more specific questions. Luck Gabino -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
Rob Dixon wrote: Tore Aursand wrote: On Thu, 13 Nov 2003 09:05:45 -0600, Dan Muey wrote: In Perl that is usually written as: for $count ( 1 .. 5 ) { print $count\n; } Or even easier: for(1..5) { print; } Or _even_ easier; print 1..5; For the subscribers who don't already know, what are the differences between my print for 1..5 for iterates over the list 1..5 and sets $_ with each value and then print is called for each item and print out the value in $_. and Tore's print 1..5 print is passed the list 1..5 and prints it out. ? (Deep magic here!) Not really. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting remote image size with Image::Size LWP
Thank you for your patience and help bringing me up to speed on how to be a better user of this list. My previous post was my first. I am trying to write a script that will use Image::Size module in conjunction with the LWP module to retrieve the height and width attribute of a gif or jpg on a remote server. Below the first script uses the Image::Size module and successfully returns the height and width of an image on the same volume. The second script uses the LWP module and depending on which version of $the_url is used, successfully returns the contents of an html file or an image file. When the image file is read it prints the raw data of the image file. Where I am at a loss is how to combine these so that I can return the height width attributes of a remote file. Any suggestions on where I might start or what I might try? Please bare with me while I learn how to use the list properly. TIA ### #!/usr/bin/perl -w use strict; use Image::Size; my $image = '/Users/mgalaher/Pictures/malden_house.jpg'; my ($globe_x, $globe_y) = imgsize($image); print $globe_x . . $globe_y; # This successfull prints the image dimensions as: 700 578 ## #!/usr/bin/perl -w use strict; # to read the files via http that each url points to. my $file = ; my $the_url = 'http://homepage.mac.com/galaher/images/maul.jpg'; # Since printing an image just shows a huge string, test with the following as well # which shows an html page: #my $the_url = 'http://homepage.mac.com/galaher/index.html'; use LWP::UserAgent; # This will cover all of them! use URI::URL; use HTTP::Request; my $hdrs = new HTTP::Headers(Accept = 'text/plain', UserAgent = 'MegaBrowser/1.0'); my $url = new URI::URL($the_url); my $req = new HTTP::Request('GET', $url, $hdrs); my $ua = new LWP::UserAgent; my $resp = $ua-request($req); if ($resp-is_success) { # If connection is successful the contents of the file # read will now go into the variable $file $file = $resp-content; } else { # If connection is not successful then make note of this print $resp-message; #$file = socket_failure; } print $file; ## -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote: Rob Dixon wrote: For the subscribers who don't already know, what are the differences between my print for 1..5 for iterates over the list 1..5 and sets $_ with each value and then print is called for each item and print out the value in $_. Not exactly -- it iterates over the *range*, and the range operator doesn't need to generate a temporary list here. print 1 .. $BIGNUM; # creates list of $BIGNUM scalars print for 1 .. $BIGNUM; # creates/discards one scalar at a time This is a documented optimization w/r/t foreach() loops, but the same thing applies to the foreach() modifier. -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Calling A C++ program
Hello All, I need to write a program to call a C++ program (mktrace). The program ask for an input file and then it ask for output file. I have 1000 files that want to input and I do not want to do one at a time. QKN -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Source Code Control and Naming ThingiePoo was Re: Starting Perl
On Thu, Nov 13, 2003 at 11:33:14AM -0800, drieux wrote: So let us step back and look at the 'root cause problem' so I want to just 'fix it on the fly' and yes, foo.pl as an editable text file will allow you simply open it with a text editor and WHACK a fix in. Unlike RealCode[tm] that has to be 'compiled' and installed. But why not treat your 'perl code' like as if it were RealCode[tm]? While that would indeed be the Best Practice, as a beginner just learning, one of the things I like about perl are the differences from other (usually compiled) languages that I'm used to. I think your answer to my original question could be summed up as don't do it that way. Which is of course valid. But by going back to the 'source' you get to edit in one fix, crank the build and release handle that punks out one more installable, and you haul it around, just like as if it were RealCode[tm] and have some knowledge about what is installed where and that your life is so much simpler. Thanks for spending the time to answer this, because that was a nicely readable and accurate description of some things that are definitely a good idea. -- chuk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Package Help
Gidday All, Im modifying this package. What it does is produce the html for our presentation templates of our content management system. I have to keep track of the number of forms on my page so I can create unique names for them, to do that I have initiated a variable FRM_CNT. One of my more experienced colleagues said I should do this in the constructor. As below. The modification I have to make is to add a sub that produces the HTML for a drop down box, one of the first tasks of this sub is to generate the form name sub getDropDownHTML { my ($self,$lstr) = @_; my $outHTML = ; my $formName = 'form'.$self-? return($outHTML); } How do I reference the FRM_CNT variable of the package, am I on the right track ? Any help appreciated. Thank You Colin package aphrweb::htmlHelper; use strict; # # This package builds HTML used: # - in 'old' workflow (new workflow (cwf) is done in cwfHelper) # - in TPLs (converts DCR fields to HTML) # # globals my %w3styles = (); my $needStyles = 1; my $tabCnt = 0; # # Constructor. # sub new { my ($proto, $sysData) = @_; my $class = ref($proto) || $proto; my $object = {}; bless $object, $class; $object-{SYS_DATA} = $sysData; $object-{W3_STYLES} = ; $object-{ASSET_URI}= /hr/global/yourcareer; $object-{ASSET_FOLDER} = globalassets; $object-{HTML_BR} = global; ++$object-{FRM_CNT}; my $debug = $sysData-{debug}; $debug-cp3Debug(htmlHelper::new,src='.$sysData-{SRC}.'); return $object; }
RE: trying again....
How do you get help on a perl module..? -Original Message- From: Jason Frisvold [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 11:48 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: trying again Check out Mail::Mailer ... I use that for 99% of my scripts that need email support.. --- Jason H. Frisvold Backbone Engineering Supervisor Engineering Dept. Penteledata RedHat Engineer - RHCE # 807302349405893 [EMAIL PROTECTED] --- I love deadlines. I especially like the whooshing sound they make as they go flying by. -- Douglas Adams [1952-2001] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 2:23 PM To: [EMAIL PROTECTED] Subject: trying again I apologize for my earlier question. I don't mean that I want someone to write a program for me. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CPAN Installs failing due to embedded in winXP directory path?
Would someone please help me to use CPAN to update / install modules. I'm using ActiveState Perl 5.6, on winXP. I'm fairly sure its happening because I stupidly set up all my programs below a 'My Programs' directory with an embedded space. The messages I get are typically like these : start of CPAN messages = Running install for module CPAN Running make for A/AN/ANDK/CPAN-1.76.tar.gz Fetching with LWP: ftp://ftp.demon.co.uk/pub/CPAN/authors/id/A/AN/ANDK/CPAN-1.76.tar.gz Fetching with LWP: ftp://ftp.demon.co.uk/pub/CPAN/authors/id/A/AN/ANDK/CHECKSUMS Checksum for C:\My Programs\DOWNLOADS\sources\authors\id\A\AN\ANDK\CPAN-1.76.tar .gz ok CPAN-1.76/ CPAN-1.76/lib/ CPAN-1.76/lib/CPAN.pm CPAN-1.76/lib/CPAN/ CPAN-1.76/lib/CPAN/Admin.pm CPAN-1.76/lib/CPAN/Nox.pm CPAN-1.76/lib/CPAN/FirstTime.pm CPAN-1.76/lib/Bundle/ CPAN-1.76/lib/Bundle/CPAN.pm CPAN-1.76/t/ CPAN-1.76/t/loadme.t CPAN-1.76/t/vcmp.t CPAN-1.76/t/signature.t CPAN-1.76/t/mirroredby.t CPAN-1.76/t/Nox.t CPAN-1.76/PAUSE2003.pub CPAN-1.76/MANIFEST CPAN-1.76/MANIFEST.SKIP CPAN-1.76/scripts/ CPAN-1.76/scripts/cpan CPAN-1.76/META.yml CPAN-1.76/BUNDLE/ CPAN-1.76/BUNDLE/Test/ CPAN-1.76/BUNDLE/Test/Builder.pm CPAN-1.76/BUNDLE/Test/More.pm CPAN-1.76/Todo CPAN-1.76/ChangeLog CPAN-1.76/Changes.old CPAN-1.76/Makefile.PL CPAN-1.76/README CPAN-1.76/SIGNATURE CPAN.pm: Going to build A/AN/ANDK/CPAN-1.76.tar.gz 'C:\My' is not recognized as an internal or external command, operable program or batch file. Running make test Make had some problems, maybe interrupted? Won't test Running make install Make had some problems, maybe interrupted? Won't install Bundle summary: The following items in bundle Bundle::CPAN had installation problems: File::Spec Digest::MD5 Compress::Zlib Archive::Tar Bundle::libnet Term::ReadKey CPAN::WAIT CPAN and the following items had problems during recursive bundle calls: Data::Dumper Net::Cmd Net::Telnet == end of CPAN messages = Any help would really be appreciated. Regards, Barry. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calling A C++ program
That sounds like a shell scripting problem. All you'd need to do is create a string like: mktrace file1 file2 mktrace file3 file4 etc... At least that would work under *nix. backgrounds the process.. So you could create a long string of files and calls to mktrace (assuming mktrace supports options on execution) and just execute it in backquotes. Of course your computer may or may not go into spasms with all that sudden work -- depending on your hardware and how much processing mktrace requiries. You may want to split up the files into blocks of 25 or 100. Then just run a while loop. -Dan On Thu, 2003-11-13 at 14:25, Quang Nguyen wrote: Hello All, I need to write a program to call a C++ program (mktrace). The program ask for an input file and then it ask for output file. I have 1000 files that want to input and I do not want to do one at a time. QKN -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: trying again....
Hi Sarah. Sarah wrote: I apologize for my earlier question. I don't mean that I want someone to write a program for me. No, and you didn't say so either. It's just that we get a little twitchy here about that sort of request. You've nothing to apologise for. I was just perhaps looking for some generic info on Perl's capability to generate email? If that exists? Perl can do all of the things you need, but first you need to know how to write Perl. You can learn from this newsgroup, but that would be slow. The best way is to read either a book or the installed documentation. We don't even know what platform you're working with or if you have Perl installed. Try perldoc perl and see if that helps. Beyond that, there are many books that can be recommended depending on your experience. To reach your goal you will also need to learn about at least the DBI and CGI modules, but learn Perl first. And don't forget that you can complain if somebody else has set you an unreasonable target without asking you. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
John W. Krahn wrote: For the subscribers who don't already know, what are the differences between my print for 1..5 for iterates over the list 1..5 and sets $_ with each value and then print is called for each item and print out the value in $_. and Tore's print 1..5 print is passed the list 1..5 and prints it out. ? (Deep magic here!) Not really. :-) Hi John. I would count you amongst those who already knew, so your entry doesn't qualify! And no, it's just Perl magic, not Perl Magic :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
Steve Grazzini wrote: On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote: Rob Dixon wrote: For the subscribers who don't already know, what are the differences between my print for 1..5 for iterates over the list 1..5 and sets $_ with each value and then print is called for each item and print out the value in $_. Not exactly -- it iterates over the *range*, and the range operator doesn't need to generate a temporary list here. print 1 .. $BIGNUM; # creates list of $BIGNUM scalars print for 1 .. $BIGNUM; # creates/discards one scalar at a time This is a documented optimization w/r/t foreach() loops, but the same thing applies to the foreach() modifier. It depends on which version of Perl you are using. :-) Older Perls would generate the list first and then iterate over it so that using a C style for loop would be more efficient. When I used the phrase iterates over the list I was refering to the concept, not the actual implementation. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Counting (easy!)
Steve Grazzini wrote: On Thu, Nov 13, 2003 at 12:09:24PM -0800, John W. Krahn wrote: Rob Dixon wrote: For the subscribers who don't already know, what are the differences between my print for 1..5 for iterates over the list 1..5 and sets $_ with each value and then print is called for each item and print out the value in $_. Not exactly -- it iterates over the *range*, and the range operator doesn't need to generate a temporary list here. print 1 .. $BIGNUM; # creates list of $BIGNUM scalars print for 1 .. $BIGNUM; # creates/discards one scalar at a time This is a documented optimization w/r/t foreach() loops, but the same thing applies to the foreach() modifier. What the code is optimised to is a touch OT, but I've never seen this documented Steve. Can you direct me? What do you think is happening under the hood for something like print for (0..0, 1, 2..5, func(6)..func(99)) ? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]