Re: Strange regular expression
On Mon, Mar 16, 2009 at 01:39, boll b...@sonic.net wrote: I'm trying to use the random_image.pl program from the nms-cgi project on sourceforge.net. This line has me baffled: if ( $baseurl !~ m%/$% ) I don't understand the function of the percent symbols. I hope someone can explain what it's doing. snip The matching operator[1] can use delimiters other than /. This is to allow cases exactly like this. If you could not change the delimiter you would have to say if ( $baseurl !~ m/\/$/ ) That said, I would normally suggest using one of the bracketing delimiters[2] instead of one of the non-bracketing delimiters like %: if ( $baseurl !~ m{/$} ) 1. http://perldoc.perl.org/perlop.html#m/PATTERN/msixpogc 2. (), [], {}, or -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box.
--- On Sun, 3/15/09, Chas. Owens chas.ow...@gmail.com wrote: From: Chas. Owens chas.ow...@gmail.com Subject: Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box. To: geeksatla...@yahoo.com Cc: Perl beginners@perl.org Date: Sunday, March 15, 2009, 5:46 AM On Sun, Mar 15, 2009 at 04:56, Ron Smith geeksatla...@yahoo.com wrote: snip Can't locate object method rvalidate via package PPM::XML::PPD::html at C:/strawberry/perl/site/lib/PPM.pm line 16 87. snip Odd, I thought the point of Strawberry Perl was to make it so that CPAN just worked on Windows and to avoid the whole ActiveState PPM mess. Try this instead: cpan Net::SSH::Perl Thanks again! Yeah, that worked just fine. There are other issues getting 'Net::SSH::Perl' installed though. When I do the install from CPAN I get: All tests successful. Files=12, Tests=106, 2 wallclock secs ( 0.13 usr + 0.06 sys = 0.19 CPU) Result: PASS TURNSTEP/Net-SSH-Perl-1.34.tar.gz Tests succeeded but one dependency not OK (Math::GMP) TURNSTEP/Net-SSH-Perl-1.34.tar.gz [dependencies] -- NA Running make install make test had returned bad status, won't install without force Then when I try installing 'Math::GMP' I get: PS C:\Documents and Settings\Ron Smith cpan Math::GMP Database was generated on Mon, 16 Mar 2009 05:39:02 GMT Running install for module 'Math::GMP' Running make for T/TU/TURNSTEP/Math-GMP-2.05.tar.gz Checksum for C:\strawberry\cpan\sources\authors\id\T\TU\TURNSTEP\Math-GMP-2.05.tar.gz ok CPAN.pm: Going to build T/TU/TURNSTEP/Math-GMP-2.05.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Math::GMP == WARNING! No GMP libraries were detected! Please see the INSTALL file. === Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL] TURNSTEP/Math-GMP-2.05.tar.gz C:\strawberry\perl\bin\perl.exe Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install PS C:\Documents and Settings\Ron Smith So, I'll be taking a look at that 'INSTALL' file first. Ron Smith geeksatla...@yahoo.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box.
On Mon, Mar 16, 2009 at 03:51, Ron Smith geeksatla...@yahoo.com wrote: snip Then when I try installing 'Math::GMP' I get: snip WARNING! No GMP libraries were detected! snip Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL] TURNSTEP/Math-GMP-2.05.tar.gz snip The Net::SSH::Perl library depends on Math::GMP or Math::Pari to do the heavy math stuff of the SSH protocol. They are both thin wrappers around C libraries. It looks like the makefile is trying to install the library for you, but is having difficulty decompressing the source due to the lack of the compress command in Windows. It looks like some other people have had your problem and found ways around it: http://www.nntp.perl.org/group/perl.win32.vanilla/2008/07/msg49.html http://win32.perl.org/wiki/index.php?title=Install_Math-Pari_on_Strawberry_Perl -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: I am considering changing my footnote style.
But only if you number them on octal. OGB On Sun, Mar 15, 2009 at 9:46 PM, John W. Krahn jwkr...@shaw.ca wrote: Chas. Owens wrote: As many of you have probably noticed, I am addicted* to footnotes in my answers. I am considering changing their format to [1], [2], [3] instead of *, **, ***. If you have any opinions you can vote for your favorite style If you *have* to have footnotes then I vote for numbered footnotes. :-) John -- Those people who think they know everything are a great annoyance to those of us who do. -- Isaac Asimov -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: I am considering changing my footnote style.
On Mon, Mar 16, 2009 at 10:16, Bob goolsby bob.gool...@gmail.com wrote: But only if you number them on octal. snip Hmm, I don't normally have more than seven footnotes, so I don't think it will be noticeable whether I a using octal, decimal, or hexadecimal. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
perl what
Hi, We have quite a bit of log information generated during our work. The thought I have is to create a tool that actually takes all the info in the log and then displays in a visual manner. I have fair amount of experience in Perl but for an application of this kind, I am wondering what I need to do this. Is perl enough? does it require some other additional tool? Please provide some guidance here. Regards, -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: use constant
- Original Message - From: Paul Johnson p...@pjcj.net To: Stanisław T. Findeisen sf181...@students.mimuw.edu.pl Cc: beginners@perl.org Sent: Thursday, 12 March, 2009 19:27:02 GMT -07:00 US/Canada Mountain Subject: Re: use constant On Thu, Mar 12, 2009 at 11:50:46PM +0100, Stanisław T. Findeisen wrote: Is there any way to change the values of [scalar/array] constants defined via use constant pragma? That seems a strange thing to want to do. But useful for redefining pi, or perhaps G, I suppose. In general the answer is no. But if you can live with a mandatory warning and the knowledge that you have lied to perl (and you understand the effects that brings, specifically with respect to constant propagation) then go ahead and do it. It's not a good idea, but it's not in perl's nature to pretend that she knows better than you, even if she does. If you want a constant that varies, can you not just use a variable? -- Paul Johnson - p...@pjcj.net http://www.pjcj.net -- I do this regularly redefine constants in my programs. I'm not sure if it's good practice but I do it. What I do is define a constant in most subroutines. The constant is called, strange enough, PROC_NM. I felt that because this was being defined local to each routine that I wasn't breaking all the rules I had been taught. I know I get a warning message each time I redefine it but to me it is a local constant not a variable. I don't define it in my helper routines so when they printout an error message and reference PROC_NM I know where they are called from. If anyone has a better idea I'd love to hear it. Suzanne. - Suzanne Aardema Systems Analyst/Programmer Applications Development Computing Services Athabasca University 1 University Drive Athabasca, AB T9S 3A3 ph: 780-421-2527 fax: 780-428-2464 email: suzan...@athabascau.ca __ This communication is intended for the use of the recipient to whom it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communications received in error, or subsequent reply, should be deleted or destroyed. --- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: perl what
On Mon, Mar 16, 2009 at 10:31, Sharan Basappa sharan.basa...@gmail.com wrote: Hi, We have quite a bit of log information generated during our work. The thought I have is to create a tool that actually takes all the info in the log and then displays in a visual manner. I have fair amount of experience in Perl but for an application of this kind, I am wondering what I need to do this. Is perl enough? does it require some other additional tool? Please provide some guidance here. snip Perl should be capable of doing whatever you want. If you need to create graphical charts you might look into Chart[1] module. 1. http://search.cpan.org/~chartgrp/Chart-2.4.1/Chart.pod -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: use constant
On Mon, Mar 16, 2009 at 11:16, Suzanne Aardema suzan...@athabascau.ca wrote: snip I do this regularly redefine constants in my programs. I'm not sure if it's good practice but I do it. What I do is define a constant in most subroutines. The constant is called, strange enough, PROC_NM. I felt that because this was being defined local to each routine that I wasn't breaking all the rules I had been taught. I know I get a warning message each time I redefine it but to me it is a local constant not a variable. I don't define it in my helper routines so when they printout an error message and reference PROC_NM I know where they are called from. If anyone has a better idea I'd love to hear it. snip It sounds like you need Readonly::XS[1]. The constant pragma creates constants by writing a subroutine like sub PI() { 3.14 } Subroutines are global in scope, so it doesn't matter that you are using the constant only in one function. Readonly::XS creates constants by turning on a bit in the scalar that makes the variable read only (hence its name). Since this is a normal scalar, it can have the scope you desire for it. The Readonly[2] module also allows you to create read only hashes and arrays (at the cost of some speed). #!/usr/bin/perl use strict; use warnings; use Readonly; func1(); func2(); sub func1 { Readonly my $PROC_NM = (caller 0)[3]; print I am in $PROC_NM\n; } sub func2 { Readonly my $PROC_NM = (caller 0)[3]; print I am in $PROC_NM\n; } 1. http://search.cpan.org/dist/Readonly-XS/XS.pm 2. http://search.cpan.org/dist/Readonly/Readonly.pm -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Error: Can't call method x without a package or object reference...
On 3/14/09 Sat Mar 14, 2009 5:28 AM, M. Coiffure coiff...@gmx.at scribbled: Hi all I'm getting this error on the following (test) script: Can't call method x without a package or object reference at test.pl line 12 ENT line 1 What I want to do is create a HashMap where the keys are names of accented characters (as they are used in entities) and the values the UTF character itself. What am I doing wrong? ENT has lines that look like this: aacute 00E1 here's my script (test.pl): --- #!/usr/bin/perl use strict; use warnings; my %ent; open ENT, entities.txt or die cannot read entities: $!; while (ENT) { chomp; m/^(.+) (.+)$/; print [$1]\t[$2]\n; $ent{$1} = \x{$2}; } --- before the error, the script prints (as expected): [aacute]\t[00E1]\n Is there anything very fundamental I'm overlooking? (please be patient with me, I'm not a computer scientist, but a linguist doing some basic programming.) You are using captured values ($1, $2) from a regulare expression match without first checking if the match succeeded: if( m/^(.+) (.+)$/ ) { print [$1]\t[$2]; }else{ print No match for $_\n; } Without seeing all of your data, it is impossible to tell what actually went wrong. Possibly the next line after 'aacute 00E1' did not match, perhaps because it was blank or contained something other than one space between entries. I think I would use split instead of a regular expression to parse lines of that type (untested): while(ENT) { chomp; my @fields = split; if( @fields == 2 ) { $ent{$fields[0]} = $fields[1]; }else{ print Invalid line: $_; } } At the least I would make the regular expression something more flexible with regard to whitespace: m/^(\S+)\s+(\S+)$/ or perhaps the more restrictive m/^(\w+)\s+(\w+)$/, depending upon the characters actually allowed in your data file. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Error: Can't call method x without a package or object reference...
On Mon, Mar 16, 2009 at 12:23, Jim Gibson jimsgib...@gmail.com wrote: snip Can't call method x without a package or object reference at test.pl line 12 ENT line 1 snip $ent{$1} = \x{$2}; snip Without seeing all of your data, it is impossible to tell what actually went wrong. Possibly the next line after 'aacute 00E1' did not match, perhaps because it was blank or contained something other than one space between entries. snip It isn't a data problem. Perl thinks he/she is trying to take the reference of the item returned by a call to the function x[1] with a malformed hashref (not an even number of list items). This is because the \x{} construct is only valid in strings. He/she also has a problem in that the \x{} does not interpolate values, it requires a hexadecimal constant. The right answer is the use hex to get the decimal value of the hexadecimal string he gets from the regex (which you rightly point out needs to have guards) and to feed that decimal value into the chr function to get the UNICODE character he/she is looking for. 1. If a function x had existed he/she would have gotten a completely different error message (i.e. the one about the malformed hash). -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
how variables definition works?
Hi, I having problems with a perl module implemented in Sun Grid Engine. This perl module (script) continuously watches the state of jobs submitted to my cluster. Every job can reach some of these states: r - run t - transfer q - queued s - suspended w - waiting In order to identify the current state of any job, the module(script) invokes the program 'qstat'. For instance, this is a regular output of this command: 4426 0.55500 data jas r 03/15/2009 15:52:19 This output indicates that there is a job who owner is the 'jas' user, with job id = 4426, submitted on 03/15/2009 15:52:19 and it is running (r). I wrote the following perl script: #!/usr/bin/perl -w $job_id = 4426; my @x = grep(/^\s+$job_id\s/,`qstat`); my @estado = split(/\s+/,$x[0]); print $estado[5]; if ($estado[5] eq r) { print ok; } else { print bad; } and it works as I expect, it prints 'rok', while the program is running. Now, I have tried to modify the 'sge.pm' module (script), but when I define a variable, for instance: my @x = grep(/^\s+$job_id\s/,`qstat`); and print the value of '@x' I got nothing. Is there a perl trick to avoid that new variables can not store some value? I appreciate your comments, PS: Please, I newbie with Perl, I have worked with C, Java and Grovy, so patience with me. Thanks so much. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: how variables definition works?
josanabr wrote: Hi, Hello, I having problems with a perl module implemented in Sun Grid Engine. This perl module (script) continuously watches the state of jobs submitted to my cluster. Every job can reach some of these states: r - run t - transfer q - queued s - suspended w - waiting In order to identify the current state of any job, the module(script) invokes the program 'qstat'. For instance, this is a regular output of this command: 4426 0.55500 data jas r 03/15/2009 15:52:19 This output indicates that there is a job who owner is the 'jas' user, with job id = 4426, submitted on 03/15/2009 15:52:19 and it is running (r). I wrote the following perl script: #!/usr/bin/perl -w #!/usr/bin/perl use warnings; use strict; $job_id = 4426; my @x = grep(/^\s+$job_id\s/,`qstat`); my @estado = split(/\s+/,$x[0]); print $estado[5]; if ($estado[5] eq r) { print ok; } else { print bad; } and it works as I expect, it prints 'rok', while the program is running. Now, I have tried to modify the 'sge.pm' module (script), but when I define a variable, for instance: my @x = grep(/^\s+$job_id\s/,`qstat`); and print the value of '@x' I got nothing. Your regular expression /^\s+$job_id\s/ says that there *must* be whitespace before the first field but your example data says there is *no* whitespace before the first field? You probably want to use /^\s*$job_id\s/ instead which says that leading whitespace is optional. If your data varies between having leading whitespace and not having leading whitespace then your second problem is that: my @estado = split(/\s+/,$x[0]); will store the state data in $estado[5] if there is leading whitespace or in $estado[4] if there is *no* leading whitespace. You need to use the special split expression of a single space character: my @estado = split(' ',$x[0]); and that way the state data will always be in $estado[4]. John -- Those people who think they know everything are a great annoyance to those of us who do.-- Isaac Asimov -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Slice?
$template-param( RESULTS = $self-dbh-selectall_arrayref(' SELECT age, day FROM table WHERE id = ?', { Slice = {} }, $self-session-param('cell')-{'sid'} ) ); I saw that code and while I do database stuff I was wondering what that Slice = {} does? Thanks, Robert -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Slice?
On 3/16/09 Mon Mar 16, 2009 3:05 PM, R. Hicks sigz...@gmail.com scribbled: $template-param( RESULTS = $self-dbh-selectall_arrayref(' SELECT age, day FROM table WHERE id = ?', { Slice = {} }, $self-session-param('cell')-{'sid'} ) ); I saw that code and while I do database stuff I was wondering what that Slice = {} does? Check the documentation for the DBI module, which you can get from 'perldoc DBI' at a command-line shell (or http://search.cpan.org/~timb/DBI-1.607/DBI.pm in a browser), in particular the description for the selectall_arrayref method, which has as its third form the following: $ary_ref = $dbh-selectall_arrayref($statement, \%attr, @bind_values); If the \%attr argument contains {Slice={}}, then the values will be returned as a hash. From the documentation: my $emps = $dbh-selectall_arrayref( SELECT ename FROM emp ORDER BY ename, { Slice = {} } ); foreach my $emp ( @$emps ) { print Employee: $emp-{ename}\n; } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Making Web Form Data Safe
I'd appreciate hearing (reading!) people's thoughts on making web form data safe for using to compose an email via sendmail. Basically, see comments in pseudo-code below, what should I be doing to the data to make it safe? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- use strict; use CGI; my $query = new CGI; my $example_data = $query-param('some_form_item'); ## What should I be doing to $example_data to make it safe?? my $sendmail = '/usr/lib/sendmail'; open (SENDMAIL, |$sendmail $webmaster) || die Can't open $sendmail!\n; # Etc. print SENDMAIL $example_data . \n; print SENDMAIL .\n; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Thanks in advance, Nigel -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Making Web Form Data Safe
Nigel Peck wrote: I'd appreciate hearing (reading!) people's thoughts on making web form data safe for using to compose an email via sendmail. Basically, see comments in pseudo-code below, what should I be doing to the data to make it safe? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- use strict; use CGI; my $query = new CGI; my $example_data = $query-param('some_form_item'); It depends. If you are going to send a plain text message, and the user submitted data is only used in the body of the message, I can't think of anything particular. OTOH, if one or more parameter is intended for the message headers, there are a few things to consider. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
[Fwd: Re: Making Web Form Data Safe]
Gunnar Hjalmarsson wrote: Nigel Peck wrote: I'd appreciate hearing (reading!) people's thoughts on making web form data safe for using to compose an email via sendmail. Basically, see comments in pseudo-code below, what should I be doing to the data to make it safe? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- use strict; use CGI; my $query = new CGI; my $example_data = $query-param('some_form_item'); It depends. If you are going to send a plain text message, and the user submitted data is only used in the body of the message, I can't think of anything particular. OTOH, if one or more parameter is intended for the message headers, there are a few things to consider. Thanks for getting back to me. For the body of the message, one thing that occurs to me is \n.\n as that would end the message? But presumably nothing else could be entered after that as sendmail would close? So there's nothing that they could inject and compromise security in any way? For the header, other than newlines, what should I consider? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: [Fwd: Re: Making Web Form Data Safe]
Nigel Peck wrote: Gunnar Hjalmarsson wrote: Nigel Peck wrote: I'd appreciate hearing (reading!) people's thoughts on making web form data safe for using to compose an email via sendmail. Basically, see comments in pseudo-code below, what should I be doing to the data to make it safe? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- use strict; use CGI; my $query = new CGI; my $example_data = $query-param('some_form_item'); It depends. If you are going to send a plain text message, and the user submitted data is only used in the body of the message, I can't think of anything particular. OTOH, if one or more parameter is intended for the message headers, there are a few things to consider. Thanks for getting back to me. For the body of the message, one thing that occurs to me is \n.\n as that would end the message? But presumably nothing else could be entered after that as sendmail would close? True. But that's not exactly a security issue, right? So there's nothing that they could inject and compromise security in any way? Not as far as I know. For the header, other than newlines, what should I consider? Not quite sure of what you mean. In CGI::ContactForm (the module I'm using for the contact form you see if you click the link below) I do something like: for ( [ user data for inclusion in message headers ] ) { s/^\s+//; s/\s+$//; s/\s+/ /g; } That wipes out all attempts to include newlines. Besides that you may want to validate possible email addresses. And please think twice before you let the users submit anything to To:, Cc: or Bcc:. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: [Fwd: Re: Making Web Form Data Safe]
Gunnar Hjalmarsson wrote: For the body of the message, one thing that occurs to me is \n.\n as that would end the message? But presumably nothing else could be entered after that as sendmail would close? True. But that's not exactly a security issue, right? No, not as long as it does close the connection, but I wasn't 100% sure that there is no risk from this. So there's nothing that they could inject and compromise security in any way? Not as far as I know. Great, thanks. For the header, other than newlines, what should I consider? Not quite sure of what you mean. Earlier you said if one or more parameter is intended for the message headers, there are a few things to consider., I just meant to ask what those things were. In CGI::ContactForm (the module I'm using for the contact form you see if you click the link below) I do something like: for ( [ user data for inclusion in message headers ] ) { s/^\s+//; s/\s+$//; s/\s+/ /g; } That wipes out all attempts to include newlines. Thanks. I will be sure to strip out newlines from now on :) Besides that you may want to validate possible email addresses. And please think twice before you let the users submit anything to To:, Cc: or Bcc:. I do some basic email validation: / ^ [...@]+ \@ (?: [^.]+ \. )+ [a-zA-Z]{2,3} $ /x The only header I use user submitted data for is the reply-to header (so I can hit reply). -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: [Fwd: Re: Making Web Form Data Safe]
Nigel Peck wrote: I do some basic email validation: / ^ [...@]+ \@ (?: [^.]+ \. )+ [a-zA-Z]{2,3} $ /x What about someb...@mail.example.com or someb...@example.info? Maybe you ought to use a module for that. The only header I use user submitted data for is the reply-to header (so I can hit reply). Sounds pretty safe to me. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Writing a column after column
Hi all, I need to consolidate columns of data available across different directories into a single excel csv file. Usually we write to a file row after row but for the current task I have, it would be convenient to write the file column after column. Is there a file writing mode for this? If not, I guess, I will have to write the matrix row by row and then take a transpose. Let me know what you guys think and if you could share some skeleton of code for something like this would be great. Thanks. -vijay -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box.
--- On Mon, 3/16/09, Chas. Owens chas.ow...@gmail.com wrote: From: Chas. Owens chas.ow...@gmail.com Subject: Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box. To: geeksatla...@yahoo.com Cc: Perl beginners@perl.org Date: Monday, March 16, 2009, 6:51 AM On Mon, Mar 16, 2009 at 03:51, Ron Smith geeksatla...@yahoo.com wrote: snip Then when I try installing 'Math::GMP' I get: snip WARNING! No GMP libraries were detected! snip Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL] TURNSTEP/Math-GMP-2.05.tar.gz snip The Net::SSH::Perl library depends on Math::GMP or Math::Pari to do the heavy math stuff of the SSH protocol. They are both thin wrappers around C libraries. It looks like the makefile is trying to install the library for you, but is having difficulty decompressing the source due to the lack of the compress command in Windows. It looks like some other people have had your problem and found ways around it: http://www.nntp.perl.org/group/perl.win32.vanilla/2008/07/msg49.html http://win32.perl.org/wiki/index.php?title=Install_Math-Pari_on_Strawberry_Perl -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. I installed 'Math::Pari' and still get 'WARNING! No GMP libraries were detected!'. So, I tried to install 'Math::GMP, but get really lost in the process of doing that. ...any further suggestions would be appreciated. Thanks. Ron Smith geeksatla...@yahoo.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
RE: I'm sure this is a common question, but I can't find the solution.
Chas. Owens wrote: If you are stuck using Windows I would suggest looking into PowerShell ... http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx Interesting. I don't have the time for coding that I used to, and I've found that it's easier if I stick to one tool chain. I've settled on GNU tools because they are available on Linux and on Windows via Cygwin. David -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
RE: Writing a column after column
vijay wrote: I need to consolidate columns of data available across different directories into a single excel csv file. Usually we write to a file row after row but for the current task I have, it would be convenient to write the file column after column. Is there a file writing mode for this? If not, I guess, I will have to write the matrix row by row and then take a transpose. Let me know what you guys think and if you could share some skeleton of code for something like this would be great. Perl is very capable of doing what you need. Off the top of my head, the p-code outline would be: declare a two-dimensional array iterate over columns read data from a source and fill a column iterate over rows write a row of data to csv output file If you're serious about learning Perl, you should get Learning Perl: http://oreilly.com/catalog/9780596520106/index.html Perl works on a great many platforms, but there can be O/S-dependent idiosyncrasies; I prefer a Linux. On Windows, I use Cygwin. HTH, David -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: perl what
Hi Chas, Clearly I did not communicate properly. So what I am looking is for some support to do some GUI stuff. The idea is take information from text and show it in the form a waveform. This will help a lot since it is rather difficult to go through the text file. Regards, Sharan On Mon, Mar 16, 2009 at 8:59 PM, Chas. Owens chas.ow...@gmail.com wrote: On Mon, Mar 16, 2009 at 10:31, Sharan Basappa sharan.basa...@gmail.com wrote: Hi, We have quite a bit of log information generated during our work. The thought I have is to create a tool that actually takes all the info in the log and then displays in a visual manner. I have fair amount of experience in Perl but for an application of this kind, I am wondering what I need to do this. Is perl enough? does it require some other additional tool? Please provide some guidance here. snip Perl should be capable of doing whatever you want. If you need to create graphical charts you might look into Chart[1] module. 1. http://search.cpan.org/~chartgrp/Chart-2.4.1/Chart.pod -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/