Re: about system() call

2018-07-24 Thread Lauren C.
yes I also found a more direct way, use Image::Resize; $image = Image::Resize->new('large.jpg'); $gd = $image->resize(250, 250); thanks for everyone. On 2018/7/25 星期三 PM 1:51, Илья Рассадин wrote: You can resize image with Perl. For example, Imager library can do the thing. See

Re: about system() call

2018-07-24 Thread Илья Рассадин
hard, I want to resize batch of images, from the large scale to small one, i.e, this image: https://miscnote.net/wp-content/uploads/2018/07/lauren.jpg (sorry but this is indeed me) currently I use system() in perl to do the work: system "convert lauren.jpg -resize 300x300 lauren.jpg" B

Re: about system() call

2018-07-24 Thread Uri Guttman
but this is indeed me) currently I use system() in perl to do the work: system "convert lauren.jpg -resize 300x300 lauren.jpg" But I think it's not good, since as you said, a shell is always being called. How to write it with pure perl way? that's easy. just call system with a list of those token

Re: about system() call

2018-07-24 Thread Lauren C.
Thanks for all kind answers. I have another question that, though this is maybe hard, I want to resize batch of images, from the large scale to small one, i.e, this image: https://miscnote.net/wp-content/uploads/2018/07/lauren.jpg (sorry but this is indeed me) currently I use system() in perl

Re: about system() call

2018-07-24 Thread Uri Guttman
On 07/24/2018 08:35 AM, Lauren C. wrote: Hi, $ perl -le 'system "df -h"' $ perl -le 'system "df","-h"' The both two styles work fine. what's the difference between them and which is better usage? this is a more technical answer than the others but it may be u

Re: about system() call

2018-07-24 Thread Darryl Philip Baker
For security I would add one additional caution. When executing a command wherever possible use the full pathname. To prevent running a malicious file hidden in your PATH. Example: “/bin/ls” and not “ls” Darryl Baker (he/him/his) Sr. System Administrator Distributed Application Platform

Re: about system() call

2018-07-24 Thread Chas. Owens
The first spawns a shell and can handle things like globs. This is less efficient, more powerful, and more dangerous (susceptible to code injection attacks) The second does not spawn a shell and therefore cannot handle globs. It is also less susceptible to code injection attacks. system &qu

about system() call

2018-07-24 Thread Lauren C.
Hi, $ perl -le 'system "df -h"' $ perl -le 'system "df","-h"' The both two styles work fine. what's the difference between them and which is better usage? thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail

Re: perlapi overrides system read()/ioctl() methods

2016-05-12 Thread Uri Guttman
On 05/12/2016 04:15 PM, Timothy Madden wrote: Hello I am trying to write an extension module (uses native C code) and I notice after including , that POSIX read() function is now overriden by a Perl macro. Can I find this explained somewhere please ? Is it safe to ignore ? Should I #undef

perlapi overrides system read()/ioctl() methods

2016-05-12 Thread Timothy Madden
Hello I am trying to write an extension module (uses native C code) and I notice after including , that POSIX read() function is now overriden by a Perl macro. Can I find this explained somewhere please ? Is it safe to ignore ? Should I #undef it, or should I create a separate .c file without

Best practice for executing system commands?

2015-01-24 Thread Mike
Which is generally considered the best practice way of executing system commands from within a Perl program? Should I use backticks or qx//, system(), or exec()? Or is there no best way and it's just a matter of what you want to return? -- To unsubscribe, e-mail: beginners-unsubscr

Re: Best practice for executing system commands?

2015-01-24 Thread Shlomi Fish
Hi Mike, On Sat, 24 Jan 2015 08:13:38 -0600 Mike ekimduna...@gmail.com wrote: Which is generally considered the best practice way of executing system commands from within a Perl program? Should I use backticks or qx//, system(), or exec()? Or is there no best way and it's just a matter

Re: Best practice for executing system commands?

2015-01-24 Thread Uri Guttman
On 01/24/2015 09:13 AM, Mike wrote: Which is generally considered the best practice way of executing system commands from within a Perl program? Should I use backticks or qx//, system(), or exec()? Or is there no best way and it's just a matter of what you want to return? even though those

Re: Solved mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-31 Thread Jan Gruber
Hi Martin, I feel embarrassed for wasting everybody's time, but I really appreciate the help. sometimes one needs to think out loud to solve a problem. I had a lot of problems like this one where it helped to get feedback from this list. Regards, Jan -- Paranoia is simply an

Re: Solved mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-31 Thread Jan Gruber
Hi Martin, I feel embarrassed for wasting everybody's time, but I really appreciate the help. sometimes one needs to think out loud to solve a problem. I had a lot of problems like this one where it helped to get feedback from this list. Regards, Jan -- Paranoia is simply an

mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Martin G. McCormick
to root. I am root when I call it. The line in question reads: system( mv $directories$filename \$directories\deleted_keys/ ); $directories and $filename are correctly set at the time. The output from the script is: usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread David Precious
On Wed, 29 Jan 2014 16:10:25 -0600 Martin G. McCormick mar...@server1.shellworld.net wrote: I keep getting the Usage help message and a permission denied. If I su to root and manually make the move, it works. change system to print to print out the command that would be run

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Hal Wigoda
help message and a permission denied. If I su to root and manually make the move, it works. The perl script is not trying to run suid to root. I am root when I call it. The line in question reads: system( mv $directories$filename \$directories\deleted_keys/ ); $directories

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Charles DeRykus
and manually make the move, it works. The perl script is not trying to run suid to root. I am root when I call it. The line in question reads: system( mv $directories$filename \$directories\deleted_keys/ ); $directories and $filename are correctly set at the time. The output from

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Ron Bergin
is not trying to run suid to root. I am root when I call it. The line in question reads: system( mv $directories$filename \$directories\deleted_keys/ ); $directories and $filename are correctly set at the time. The output from the script is: usage: mv [-f | -i | -n] [-v] source target

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Martin G. McCormick
the $filename is added. You'll see in a previous message that I really goofed. The $filename variable contained the correct string but also contained a newline at the end so chomp was in order. I removed all quotes except for the beginning and ending quotes in the system command. I am

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Martin G. McCormick
David Precious writes: change system to print to print out the command that would be run, Great suggestion! I actually did try that using echo instead of print so that system was still involved and the values were correct. It looked beautiful. and (a) you'll likely see the problem, or (b) you

Solved mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Martin G. McCormick
This is a classic example of the admonition, Never trust data. I did try the following: David Precious writes: change system to print to print out the command that would be run, and (a) you'll likely see the problem, or (b) you can try running that exact command. I

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Shawn H Corey
On Thu, 30 Jan 2014 07:47:29 -0600 Martin G. McCormick mar...@server1.shellworld.net wrote: David Precious writes: change system to print to print out the command that would be run, Great suggestion! I actually did try that using echo instead of print so that system was still involved

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-19 Thread John W. Krahn
SSC_perl wrote: Hi John, Hello, Thanks for getting back to me with your findings. I really appreciate it. I've gone through everything, made the changes that I could, and I have some questions to some of your remarks. You are using the value from readdir() without prepending the

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-19 Thread Jim Gibson
On Nov 18, 2013, at 2:02 PM, SSC_perl p...@surfshopcart.com wrote: Surf.pm:65: $cookie =~ Encode($cookie); Surf.pm:66: $value =~ Encode($value); Did you really mean to use the return value from Encode() as a regular expression? Unfortunately, I can't

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-19 Thread SSC_perl
On Nov 19, 2013, at 3:17 AM, John W. Krahn wrote: readdir() returns just the file names, without the path. Thanks, John. I didn't realize that. This morning, I found http://perldoc.perl.org/functions/readdir.html and read the following: If you're planning to filetest the return

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-19 Thread SSC_perl
On Nov 19, 2013, at 8:40 AM, Jim Gibson wrote: That’s all the analysis I have time for. I really appreciate the analysis. It gives me a lot to go on. Thanks, Frank

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-18 Thread SSC_perl
Hi John, Thanks for getting back to me with your findings. I really appreciate it. I've gone through everything, made the changes that I could, and I have some questions to some of your remarks. You are using the value from readdir() without prepending the path to the file name.

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-18 Thread Jim Gibson
On Nov 18, 2013, at 2:02 PM, SSC_perl wrote: Hi John, Thanks for getting back to me with your findings. I really appreciate it. I've gone through everything, made the changes that I could, and I have some questions to some of your remarks. You should be responding to the list,

Re: [OT] SurfShopPRO Perl shopping cart system is now open source

2013-11-14 Thread John W. Krahn
SSC_perl wrote: Hello, Hello, This is a one-time post to announce that the SurfShopPRO Perl shopping cart system is going open source. Our site hasn't been fully updated yet, but you can download the cart and check it our for yourself. We are looking for developers, designers

[OT] SurfShopPRO Perl shopping cart system is now open source

2013-10-28 Thread SSC_perl
Hello, This is a one-time post to announce that the SurfShopPRO Perl shopping cart system is going open source. Our site hasn't been fully updated yet, but you can download the cart and check it our for yourself. We are looking for developers, designers, and testers. http

Re: what's the problem with a system call

2013-05-16 Thread Manuel Reimer
Shlomi Fish wrote: What system() does (at least on UNIX-like OSes) is fork a child, call exec() with a new process and wait for the new child to terminate (plus some other stuff to get rid of misbehaviours). ... and if you call system with just one long string, then Perl opens the system

Re: what's the problem with a system call

2013-05-14 Thread Luca Ferrari
On Tue, May 14, 2013 at 5:35 AM, xiaolan practicalp...@gmail.com wrote: Hello, what's the disadvantage when calling a system command from Perl? i.e, system call to rsync rather than using the File::Rsync module. is it hard to control the signals between the caller process and the called

Re: what's the problem with a system call

2013-05-14 Thread Brian Fraser
On Tue, May 14, 2013 at 12:35 AM, xiaolan practicalp...@gmail.com wrote: Hello, what's the disadvantage when calling a system command from Perl? i.e, system call to rsync rather than using the File::Rsync module. is it hard to control the signals between the caller process and the called

Re: what's the problem with a system call

2013-05-14 Thread Shlomi Fish
Hi Brian, thanks for replying well to xiaolan’s question. Regards, Shlomi Fish -- - Shlomi Fish http://www.shlomifish.org/ My Public Domain Photos - http://www.flickr.com/photos/shlomif/ 95% of Programmers consider

Re: what's the problem with a system call

2013-05-14 Thread xiaolan
Thanks all the answers. Shlomi long time no see :) Have another question that, what's the difference between the system call child process and the native forked child process? Does the child process of system call have the problems of receiving signals from the parent? On Tue, May 14, 2013

Re: what's the problem with a system call

2013-05-14 Thread Shlomi Fish
Hi xiaolan, On Tue, 14 May 2013 18:51:51 +0800 xiaolan practicalp...@gmail.com wrote: Thanks all the answers. Shlomi long time no see :) Yes. :-) I am available on IM: http://www.shlomifish.org/me/contact-me/ Have another question that, what's the difference between the system call

what's the problem with a system call

2013-05-13 Thread xiaolan
Hello, what's the disadvantage when calling a system command from Perl? i.e, system call to rsync rather than using the File::Rsync module. is it hard to control the signals between the caller process and the called system command? Thanks.

Re: check processes accessing file system

2013-01-10 Thread David Precious
On Wed, 9 Jan 2013 17:45:51 -0800 (PST) Paul.G medur...@yahoo.com.au wrote: Is there a quck way to test if processes are accessing file system in perl? That's quite a vague requirement. Find out what processes have a specific file open? Find out what processes are doing IO at that specific

Re: check processes accessing file system

2013-01-10 Thread Shlomi Fish
Hi Paul, On Wed, 9 Jan 2013 17:45:51 -0800 (PST) Paul.G medur...@yahoo.com.au wrote: Hi Is there a quck way to test if processes are accessing file system in perl? If you are using Linux you can use: * https://metacpan.org/search?q=inotify I think the *BSDs have some similar mechanisms

Re: check processes accessing file system

2013-01-10 Thread Paul.G
, 10 January 2013 8:22 PM Subject: Re: check processes accessing file system On Wed, 9 Jan 2013 17:45:51 -0800 (PST) Paul.G medur...@yahoo.com.au wrote: Is there a quck way to test if processes are accessing file system in perl? That's quite a vague requirement. Find out what processes have

Re: check processes accessing file system

2013-01-10 Thread David Precious
On Thu, 10 Jan 2013 05:01:38 -0800 (PST) Paul.G medur...@yahoo.com.au wrote: Linux/Unix you would use. eg: fuser -c /tmp or lsof could also be used. I was wondering if there was a perl module that does the same thing. See Unix::Lsof then, as per my reply - it should do what you need.

Re: check processes accessing file system

2013-01-10 Thread Paul.G
thanks From: David Precious dav...@preshweb.co.uk To: beginners@perl.org Sent: Friday, 11 January 2013 12:07 AM Subject: Re: check processes accessing file system On Thu, 10 Jan 2013 05:01:38 -0800 (PST) Paul.G medur...@yahoo.com.au wrote: Linux/Unix you

check processes accessing file system

2013-01-09 Thread Paul.G
Hi Is there a quck way to test if processes are accessing file system in perl? cheers Paul

sudo module; how to use on remote system

2012-09-30 Thread Rajeev Prasad
Hello Joe, How to use your module on a remote system? module is not installed on remote system, but on my local machine. i am usinf net::openssh to connect to remote system. tx. Rajeev

Re: system command not working in different versions

2012-08-09 Thread Owen
venki_neeli...@yahoo.com Cc: perl list beginners@perl.org Sent: Wednesday, 8 August 2012 3:55 PM Subject: Re: system command not working in different versions One suggestion. Did you compare the shebang line of your submit_now.pl and your perl executable location in the 2nd machine where

Re: system command not working in different versions

2012-08-09 Thread Hal Wigoda
location. Regards, Neeli From: midhun midhun...@gmail.com To: venki neeli venki_neeli...@yahoo.com Cc: perl list beginners@perl.org Sent: Wednesday, 8 August 2012 3:55 PM Subject: Re: system command not working in different versions One suggestion. Did you

Re: system command not working in different versions

2012-08-09 Thread midhun
venki_neeli...@yahoo.com Cc: perl list beginners@perl.org Sent: Wednesday, 8 August 2012 3:55 PM Subject: Re: system command not working in different versions One suggestion. Did you compare the shebang line of your submit_now.pland your perl executable location in the 2nd machine where

Re: system command not working in different versions

2012-08-09 Thread venki neeli
: system command not working in different versions Neeli, Hal is right. Try $which perl from your shell. The location may differ. Regards, Midhun On Thu, Aug 9, 2012 at 11:46 AM, Hal Wigoda hal.wig...@gmail.com wrote: What about the location of perl itself? On Thu, Aug 9, 2012 at 12:13 AM, venki

Re: system command not working in different versions

2012-08-09 Thread Paul Anderson
midhun...@gmail.com To: Hal Wigoda hal.wig...@gmail.com Cc: venki neeli venki_neeli...@yahoo.com; perl list beginners@perl.org Sent: Thursday, 9 August 2012 12:01 PM Subject: Re: system command not working in different versions Neeli, Hal is right. Try $which perl from your shell

Re: system command not working in different versions

2012-08-09 Thread Shawn H Corey
On Thu, 9 Aug 2012 15:17:57 +0800 (SGT) venki neeli venki_neeli...@yahoo.com wrote: What may be the problem? is it with version of perl? or perl module problem? It may be a difference in the shell. When there are metacharacters present, system uses sh(1) to interpret them. Try this on your

RE: system command not working in different versions

2012-08-09 Thread Bob McConnell
From: Shawn H Corey On Thu, 9 Aug 2012 15:17:57 +0800 (SGT) venki neeli venki_neeli...@yahoo.com wrote: What may be the problem? is it with version of perl? or perl module problem? It may be a difference in the shell. When there are metacharacters present, system uses sh(1

Re: system command not working in different versions

2012-08-09 Thread Shawn H Corey
to be a difference in the environments between your login and the user that actually executes the script. But that doesn't determine which shell system() uses. Most users are automatically assign bash(1) as their default shell. Most perls use sh(1). On my machine, sh(1) is symbolically linked to dash(1

system command not working in different versions

2012-08-08 Thread venki neeli
Dear Friends, I am developing a script in which I need to call another perl script. In one linux machine it is working and in the other machine it is not working. Ex:- system(./submit_now.pl $); can you please, tell me what is the reason? and as well solution. Regards, Neeli

Re: system command not working in different versions

2012-08-08 Thread Jeff Pang
You might want to tell us what's the output for error. Some reasons include the file path, the permissions etc. I am developing a script in which I need to call another perl script. In one linux machine it is working and in the other machine it is not working. Ex:- system(./submit_now.pl

Re: system command not working in different versions

2012-08-08 Thread midhun
need to call another perl script. In one linux machine it is working and in the other machine it is not working. Ex:- system(./submit_now.pl $); can you please, tell me what is the reason? and as well solution. Regards, Neeli -- -Midhun

Re: system command not working in different versions

2012-08-08 Thread Shawn H Corey
venki_neeli...@yahoo.comwrote: Dear Friends, I am developing a script in which I need to call another perl script. In one linux machine it is working and in the other machine it is not working. Ex:- system(./submit_now.pl $); can you please, tell me what is the reason? and as well

Re: system command not working in different versions

2012-08-08 Thread venki neeli
...@yahoo.com Cc: perl list beginners@perl.org Sent: Wednesday, 8 August 2012 3:55 PM Subject: Re: system command not working in different versions One suggestion. Did you compare the shebang line of your submit_now.pl and your perl executable location in the 2nd machine where it is not working

Re: File health check on *nix system using stat

2011-12-12 Thread John W. Krahn
probably only need to read one byte to see if the file is readable. He is checking that the operating system returns the same number of bytes that stat says the file contains. And you couldn't confirm that by seeking to the end of the file and reading one byte because there may be invalid disk

Re: File health check on *nix system using stat

2011-12-12 Thread Peter Scott
On Sun, 11 Dec 2011 10:40:24 -0400, frank cui wrote: Ok, to make this question more specific, the author of this book is making a program to check if the files can be read off from the disk. And he does so by checking two steps, first is making sure the meta data of this file looks fine, and

Re: File health check on *nix system using stat

2011-12-11 Thread frank cui
Thanks John and Peter for the reply. Ok, to make this question more specific, the author of this book is making a program to check if the files can be read off from the disk. And he does so by checking two steps, first is making sure the meta data of this file looks fine, and secondly by reading

File health check on *nix system using stat

2011-12-10 Thread frank cui
hi, I'm reading the book of automating system administration with perl and having doubts about this code snippets about file health check. # attempt to read the directory entry for this file my @stat = stat($name); if ( !$stat[4] !$stat[5] !$stat[6] !$stat[7] !$stat[8] ) { return 0

Re: File health check on *nix system using stat

2011-12-10 Thread John W. Krahn
frank cui wrote: hi, Hello, I'm reading the book of automating system administration with perl and having doubts about this code snippets about file health check. # attempt to read the directory entry for this file my @stat = stat($name); That should probably be: my @stat = stat($name

Re: File health check on *nix system using stat

2011-12-10 Thread Peter Scott
On Sat, 10 Dec 2011 11:11:15 -0400, frank cui wrote: # attempt to read the directory entry for this file my @stat = stat($name); if ( !$stat[4] !$stat[5] !$stat[6] !$stat[7] !$stat[8] ) { return 0;# according to the code context, here it is saying the file is NOT

system command question

2011-09-28 Thread Amish Rughoonundon
to do this in perl using a system call but it failed system(SET A_DIR=C:\\TOOLS\\TMS320 SET C_DIR=C:\\TOOLS\\TMS320 PATH=\%PATH\%;C:\\TOOLS;C:\\TOOLS\\TMS320 make compilation_output.txt); Any idea why the system command is not setting the path and A_DIR and C_DIR correctly. Thanks, Amish

RE: system command question

2011-09-28 Thread Ken Slater
-Original Message- From: Amish Rughoonundon [mailto:amishrughoonun...@gmail.com] Sent: Tuesday, September 27, 2011 4:44 PM To: beginners@perl.org Subject: system command question Hi, I am trying to run a make file from perl. For the make file to run, some environment variables

Re: redirect system command STDER

2011-07-20 Thread Christian Walde
On Tue, 19 Jul 2011 21:14:10 +0200, Tessio Fechine oiss...@gmail.com wrote: Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER

Re: redirect system command STDER

2011-07-20 Thread Kevin Spencer
On Tue, Jul 19, 2011 at 12:14 PM, Tessio Fechine oiss...@gmail.com wrote: Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER

Re: redirect system command STDER

2011-07-20 Thread Shlomi Fish
= system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER. Is it possible with system? You can use a shell process to discard STDERR messages (untested): my $cmd = useradd -m $account 2 /dev/null; my $result = system($cmd); The problem

Fw: redirect system command STDER

2011-07-20 Thread Shlomi Fish
Subject: Re: redirect system command STDER Message-ID: 20110720124245.0192b...@telaviv1.shlomifish.org In-Reply-To: ca4b5fb6.13520%jimsgib...@gmail.com References: CAKp6Vayo4JsCnPk2LkUgJ8EQ3wmNEqFC5LrNqkk9m8fkhsa=f...@mail.gmail.com ca4b5fb6.13520%jimsgib...@gmail.com X-Mailer: Claws Mail

Re: redirect system command STDER

2011-07-20 Thread C.DeRykus
On Jul 20, 12:45 am, walde.christ...@googlemail.com (Christian Walde) wrote: On Tue, 19 Jul 2011 21:14:10 +0200, Tessio Fechine oiss...@gmail.com wrote: Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd

redirect system command STDER

2011-07-19 Thread Tessio Fechine
Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error message to STDER. Is it possible with system? Thanks!

Re: redirect system command STDER

2011-07-19 Thread Jim Gibson
On 7/19/11 Tue Jul 19, 2011 12:14 PM, Tessio Fechine oiss...@gmail.com scribbled: Hello, I have a subroutine that uses useradd to create accounts -- @cmd = ('useradd', '-m', $account); my $result = system @cmd; -- but when useradd fails, I need to stop it from sending the error

Re: Loading library different per Operating System

2011-06-12 Thread JPH
Here is how I solved it: use if $^O eq linux , Device::SerialPort = qw( :PARAM :STAT 0.07 ); use if $^O eq MSWin32 , Win32::SerialPort = qw( :PARAM :STAT 0.19 ); Thanks! On 06/12/2011 03:13 AM, Dr.Ruud wrote: On 2011-06-11 17:20, JP wrote: How can I load a library depending on the

Loading library different per Operating System

2011-06-11 Thread JP
); } elsif ( $OS eq MSWin32 ) { use Win32::SerialPort qw( :PARAM :STAT 0.07 ); } else { die Unsupported Operating System: $OS\n; }; But the loading of the libraries is done during compile and therefore this will allways fail with an Can't locate /SerialPort.pm in @INC.\ How can I load a library

Re: Loading library different per Operating System

2011-06-11 Thread Shawn H Corey
( :PARAM :STAT 0.07 ); } else { die Unsupported Operating System: $OSNAME\n; }; } -- Just my 0.0002 million dollars worth, Shawn Confusion is the first step of understanding. Programming is as much about organization and communication as it is about coding. The secret to great

Re: Loading library different per Operating System

2011-06-11 Thread Dr.Ruud
On 2011-06-11 17:20, JP wrote: How can I load a library depending on the platform I run on? A use statement is always processed at compile time, no matter if there are BEGIN blocks or if statements around it, or where it is in the source. Check out use if (see perldoc if), or do the

Re: Rsync options not recognized by system function

2011-05-31 Thread Chris Nehren
On Fri, May 27, 2011 at 14:10:16 -0700 , John W. Krahn wrote: The real problem is that $RSYNC_OPTS contains whitespace and you can't mix system(LIST) and system(STRING) together like that. It has to be either: system($RSYNC, split( ' ', $RSYNC_OPTS ), $host:/Blah/blah/Blue/$host_env

Rsync options not recognized by system function

2011-05-27 Thread Ezra Taylor
Hello All: My rsync options are not being recognized in the system function. I tried escaping the asterisks and single quotes to no avail. Also, I do not want to install any rsync modules. Your help will be much appreciated. Thanks. my $RSYNC_OPTS=' -auvr --include

Re: Rsync options not recognized by system function

2011-05-27 Thread Kenneth Wolcott
On Fri, May 27, 2011 at 12:10, Ezra Taylor ezra.tay...@gmail.com wrote: Hello All:                My rsync options are not being recognized in the system function.  I tried escaping the asterisks and single quotes to no avail. Also, I do not want to install any rsync modules.  Your help

Re: Rsync options not recognized by system function

2011-05-27 Thread Uri Guttman
ET == Ezra Taylor ezra.tay...@gmail.com writes: ET Hello All: ET My rsync options are not being recognized in the system ET function. I tried escaping the asterisks and single quotes to no avail. ET Also, I do not want to install any rsync modules. Your help

Re: Rsync options not recognized by system function

2011-05-27 Thread John W. Krahn
Uri Guttman wrote: ET == Ezra Taylorezra.tay...@gmail.com writes: ET Hello All: ET My rsync options are not being recognized in the system ET function. I tried escaping the asterisks and single quotes to no avail. ET Also, I do not want to install any rsync

Re: Perl For system admin

2011-05-25 Thread Shlomi Fish
Hi Fudmer, next time, please reply to all recipients and don't send the reply only to me. See below for my response: On Wednesday 25 May 2011 13:53:53 fudmer rieley wrote: I c/n get the referenced link to open.. said page not found?

Re: Perl For system admin

2011-05-24 Thread Shawn H Corey
On 11-05-24 12:10 AM, vishesh kumar wrote: Hi Members, I am a linux system admin. I want to use perl as a command line like sed and awk. For example suppose , i need to extract IP Addr from a string or file using regrex i mean str=hello ip is 192.168.2.1 and data is xxx And i want ip addr

Re: Perl For system admin

2011-05-24 Thread Shlomi Fish
Hi Shawn (and all), On Tuesday 24 May 2011 15:05:06 Shawn H Corey wrote: On 11-05-24 12:10 AM, vishesh kumar wrote: Hi Members, I am a linux system admin. I want to use perl as a command line like sed and awk. For example suppose , i need to extract IP Addr from a string

Perl For system admin

2011-05-23 Thread vishesh kumar
Hi Members, I am a linux system admin. I want to use perl as a command line like sed and awk. For example suppose , i need to extract IP Addr from a string or file using regrex i mean str=hello ip is 192.168.2.1 and data is xxx And i want ip addr only using Regex echo $str | perl -pe

Re: format output from system command

2011-04-16 Thread Peter Scott
On Fri, 15 Apr 2011 08:53:12 -0700, sono-io wrote: On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: open ('FILEOUT', '', 'cmdout') ||die cant open cmdout: $! \n; Is that O.K.? You are still using a bareword filehandle. Putting single quotes around the filehandle allows

Re: format output from system command

2011-04-15 Thread Shlomi Fish
Hi jet speed, On Friday 15 Apr 2011 00:23:17 jet speed wrote: Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 2:11 AM, Shlomi Fish wrote: 1. Don't use bareword file-handles. 2. Use the three-args open: open (my $file_our, '', 'cmdout') or die Cannot open cmdout: $!; What about writing it like this: open ('FILEOUT', '', 'cmdout') ||die cant open cmdout: $! \n;

Re: format output from system command

2011-04-15 Thread Alan Haggai Alavi
Hello Marc, What about writing it like this: open ('FILEOUT', '', 'cmdout') ||die cant open cmdout: $! \n; Is that O.K.? You are still using a bareword filehandle. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail:

Re: format output from system command

2011-04-15 Thread sono-io
On Apr 15, 2011, at 8:37 AM, Alan Haggai Alavi wrote: open ('FILEOUT', '', 'cmdout') ||die cant open cmdout: $! \n; Is that O.K.? You are still using a bareword filehandle. Putting single quotes around the filehandle allows it to pass Perl Critic, so I was just curious about

Re: format output from system command

2011-04-15 Thread Shawn H Corey
On 11-04-15 11:22 AM, sono...@fannullone.us wrote: open ('FILEOUT', '', 'cmdout') ||die cant open cmdout: $! \n; Is that O.K.? The problem with not using lexical-scoped file handles is that if a module opens a file using the same name, it closes yours. It's best if you limit the

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and outputs

format output from system command

2011-04-14 Thread jet speed
Hi, I need help in formatting ouput from system command, i could'nt figure out a way to format output from system command. appreciate your help with this, the details are below. hlis3 is file with list of clients hosta hostb hostc hostd The below program looks through each client and outputs

Re: Accessing file system from CGI

2010-11-20 Thread Mike Martin
issue. What does the system that runs this CGI program is running (operating system, distribution, version, etc.)? Did you try it at home? This applies to ls, opendir and find. Well, you shouldn't normally use the ls and find programs from within Perl, but thanks for trying. When you login

Accessing file system from CGI

2010-11-19 Thread Mike Martin
Has anyone got any approaches that enable cgi scripts to access the host filesystem (readonly) I am working on a doc viewer app (intended for release as part of a suite), but I am hitting the permission denied issue. This applies to ls, opendir and find. any ideas appreciated -- To

Re: Accessing file system from CGI

2010-11-19 Thread Jeff Pang
You may make the filesystem readable to httpd's running user like nobody. Perl has no way doing something more effective. 2010/11/18 Mike Martin m...@redtux.org.uk: Has anyone got any approaches that enable cgi scripts to access the host filesystem (readonly) I am working on a doc viewer app

Re: Accessing file system from CGI

2010-11-19 Thread Shlomi Fish
-wise permissions. However, note that many web-servers will run CGI scripts under a very unprivileged UNIX user. I am working on a doc viewer app (intended for release as part of a suite), but I am hitting the permission denied issue. What does the system that runs this CGI program

Re: How to copy and execute a file from source host to a remote windows system using perl ?

2010-10-29 Thread Shlomi Fish
Hi Amit, On Thursday 28 October 2010 16:04:22 Amit Saxena wrote: Hi all, Please let me know a way to copying from source host and executing a file on a remote windows system using perl when 1. When the password of administrator account on the remote host is known. 2. When the password

  1   2   3   4   5   6   7   8   9   10   >