Re: Can a perl programmer find jobs today?

2023-02-17 Thread Kelvin Wu
You may look into this in another way, it is indeed difficult to find a job
to do pure Perl programming nowadays, but Perl is very commonly used by QA,
DevOps, SRE. Having Perl/Python skills will help you get the positions in
these domains, so don't just look for a Perl job.


On Sat, Feb 18, 2023 at 1:41 AM Open Mbox  wrote:

> python and AI are different stuff, just like shovel and farming.
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Re: Using Net::SSH::Perl to execute a set of commands

2006-06-13 Thread Kelvin Wu

Sorry I didn't get you, why it is related to Math::BigInt::GMP?
To me  it sounds like a SSH interactive issue...


On 30/05/06, Oyler, Nathan [EMAIL PROTECTED] wrote:


Have you installed Math::BigInt::GMP?

Might not be it, but I was having a somewhat similar problem that it
fixed.


 -Original Message-
 From: Kelvin Wu [mailto:[EMAIL PROTECTED]
 Sent: Monday, May 29, 2006 19:44 PM
 To: Perl
 Subject: Using Net::SSH::Perl to execute a set of commands

 Hi,

 I was trying to use Net::SSH::Perl to log into a remote box and
execute a
 program with pre-defined commands, something like:


 #!/usr/bin/perl

 use strict;
 use Net::SSH::Perl;

 my $ssh = Net::SSH::Perl-new(ip, debug = 0);
 $ssh-login(name, password);
 my ($return) = $ssh-cmd(minicom -S mini_script_vpn.force);
 print $return;

 minicom is a program, and mini_script_vpn.force is a script which
defined
 a
 set of commands sent to minicom

 The terminal output should be something like: (if run the program
manually
 from shell)

  minicom -S mini_script_vpn.force
 minicom: WARNING: please don't run minicom as root when not
maintaining
   it (with the -s switch) since all changes to the
   configuration will be GLOBAL !.

 Welcome to minicom 1.83.1

 OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
 Compiled on May  3 2001, 22:36:07.

 Press CTRL-A Z for help on special keys

 Logging in..

 c_fwenable
 Password:
 c_fw#Resetting VPN
 configure terminal
 c_fw(config)#Clear ipsec
 clear crypto ipsec sa
 c_fw(config)#Clear isakmp
 clear crypto isakmp sa
 c_fw(config)#Logging out and leaving...
 Killed

 But when I was running this command via the Perl Script above,

 shell: RSA authentication failed: Can't load public key.
 shell: Doing challenge response authentication.
 shell: No challenge presented.
 shell: Trying password authentication.
 shell: Sending command: minicom -S mini_script_vpn.force
 shell: Entering interactive session.

 It quits immediately after sending command.

 Any suggestion?

 Thanks



Using Net::SSH::Perl to execute a set of commands

2006-05-29 Thread Kelvin Wu

Hi,

I was trying to use Net::SSH::Perl to log into a remote box and execute a
program with pre-defined commands, something like:


#!/usr/bin/perl

use strict;
use Net::SSH::Perl;

my $ssh = Net::SSH::Perl-new(ip, debug = 0);
$ssh-login(name, password);
my ($return) = $ssh-cmd(minicom -S mini_script_vpn.force);
print $return;

minicom is a program, and mini_script_vpn.force is a script which defined a
set of commands sent to minicom

The terminal output should be something like: (if run the program manually
from shell)


minicom -S mini_script_vpn.force

minicom: WARNING: please don't run minicom as root when not maintaining
 it (with the -s switch) since all changes to the
 configuration will be GLOBAL !.

Welcome to minicom 1.83.1

OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
Compiled on May  3 2001, 22:36:07.

Press CTRL-A Z for help on special keys

Logging in..

c_fwenable
Password:
c_fw#Resetting VPN
configure terminal
c_fw(config)#Clear ipsec
clear crypto ipsec sa
c_fw(config)#Clear isakmp
clear crypto isakmp sa
c_fw(config)#Logging out and leaving...
Killed

But when I was running this command via the Perl Script above,

shell: RSA authentication failed: Can't load public key.
shell: Doing challenge response authentication.
shell: No challenge presented.
shell: Trying password authentication.
shell: Sending command: minicom -S mini_script_vpn.force
shell: Entering interactive session.

It quits immediately after sending command.

Any suggestion?

Thanks


Re: match file name at end of a http url

2006-04-25 Thread Kelvin Wu
 if ($url =~ /\/([^\/]*)$/) {
print $1;
 }


On 26/04/06, Tom Phoenix [EMAIL PROTECTED] wrote:

 On 4/25/06, nishanth ev [EMAIL PROTECTED] wrote:

  if( $url =~ /\/([\w.]*$)/ ){
  print $1;
  }

   http://example.com/some-file.txt

   To process a URL requires more than a simple pattern
   match. Use a
   module from CPAN. Cheers!

 What I said.

 --Tom Phoenix
 Stonehenge Perl Training

 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response





KILL INT can not wake up $SIG{INT}

2004-12-19 Thread Kelvin Wu
Hi list,

Anyone has such experience? KILL INT pid cannot wake up $SIG{INT}  sub{}.

my code is like;

$SIG{INT} = sub {#load pm}

$SIG{ALRM} = sub {print Driver $pm is going to sleep... bye.\n; exit;};

the pm actually has a system call to execute something
sub xxx {
`perl xxx.pl` 
}

but  

my $tmp = kill INT, $pid; ## it returns number of processes, eg: 1
cannot wake up the $SIG{INT}  at all after $SIG{ALRM} has been executed.

does system call cause the problem?

Thanks.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Net::FTP::SSL ?

2004-12-06 Thread Kelvin Wu
Hello Perl,

I am looking for a Perl module which is used to access FTPd via SSL,
Auth TLS. Is there something called Net::FTP::SSL or others?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: decompress downloaded page

2004-11-24 Thread Kelvin Wu
use Compress::Zlib;
my $results = Compress::Zlib::memGunzip($resp-content);


On Wed, 24 Nov 2004 14:32:27 +0100, Ing. Branislav Gerzo [EMAIL PROTECTED] 
wrote:
 Hi all,
 
 I have this snippet, and I'd like to decompress its contents:
 
 sub dwl {
my $ua = LWP::UserAgent-new;
$ua-default_header('Accept-Encoding' = 'gzip, deflate');
$resp = $ua-get(@_);
return ($resp-content, $resp-status_line, $resp-is_success) if 
 wantarray;
return unless $resp-is_success;
return $resp-content;
 }
 
 thanks for any idea.
 
 --
 
 --. ,--  ,- ICQ: 7552083  \|||/`//EB: www.2ge.us
 ,--' |  - |--IRC: [2ge](. .),\\SN: 2ge!2ge_us
 `+==+=+===~  ~=-o00-(_)-00o-~
 *   - Tribble   */-- Tribble with a lightsaber
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Net::FTP Help !

2004-08-13 Thread Kelvin Wu
the raw list returned from ftp server is something like this:

drwx--x--x5 529  529  4096 Mar 10 13:56 ..
-rwxr-xr-x1 529  529  8504  Mar 11 14:44 aboutus.html
drwx--x--x4 529  529  4096 Mar 11 13:54 cgi-bin

those lines start with 'd' are directories, 'l' are symblinks.

 next if ($2 eq '.' or $2 eq '..');
sorry my mistake. it shoud be:

 # Store file name
 if ($_ =~ /(.+)(\d\d:\d\d) (.+)/) {
   push @files, $3;
 }

if you are sure you don't have any file/dir name containing spaces,
you can split the raw list by spaces and take the last element of
array as filename.

for (@raw_list) {
my @dirinfo = split(/\s+/, $_);
next if $dirinfo[0] =~ /^d|^l/;
push @files, $dirinfo[8];
}

this is much easy but it won't work for those file name containing spaces:
-rwxr-xr-x1 529  529  8504  Mar 11 14:44 about us.html
'about' will be push into files array, not 'about us.html'


On Tue, 10 Aug 2004 10:38:53 -0500, Chris Federico
[EMAIL PROTECTED] wrote:
 Thanks Kelvin  /Wiggins ..
 
 Kelvin when you say next if $_ =~ /^d|^l/; are you pattern mattching
 here ? Being new to this it seems confusing to me also:
 
 if ($_ =~ /(.+)(\d\d:\d\d) (.+)/) {
next if ($2 eq '.' or $2 eq '..');
push @files, $2;
 
 In terms I can understand what is this doing ..
 
 Thanks
 
 Chris
 
 
 
 
 -Original Message-
 From: Kelvin Wu [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 09, 2004 10:44 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Net::FTP Help !
 
 my @raw_list = $ftp-dir($remote_dir);
 my @files;
 for (@raw_list) {
  # Skip directory and symblink
  next if $_ =~ /^d|^l/;
 
  # Store file name
  if ($_ =~ /(.+)(\d\d:\d\d) (.+)/) {
next if ($2 eq '.' or $2 eq '..');
push @files, $2;
  }
 }
 
 On Mon, 9 Aug 2004 19:38:19 -0600, Wiggins d Anconia
 [EMAIL PROTECTED] wrote:
  
   Hi Guys and Gals ,
  
I'm new to perl ... Here is my problem ..
  
   I'm connecting fine to the remote computer and logging in fine ..
   what I want to do is  a get all files from the remote directory .
   Here is is a snippet of the code
  
   $ftp-cwd($remote_dir)
   or die cannot change working directory , $ftp-message;
  
   # show current directory
   $ftp-pwd();
  
  
   @all_files = $ftp-ls();
  
   print @all_files;
  
  
   foreach $file(@all_files) {
  
   $ftp-get($file)
   or die cannot get file, $ftp-message; }
  
  
  
   The problem is that the remote directory has a subdirectory in it so
 the
   array reads it in @all_files = $ftp-ls; so when I go to do a
   $ftp-get($file) it reads the subdirectory name into it as well so
 it
   bombs out saying it cannot find file BLAH BLAH ... is there a way to
   read the directory without the subdirectory in there .. just the
 files I
   want to get .
  
  
  
   Hope this is clear ..
  
  
 
  You can use the 'dir' method to get a long listing, which should
 include
  the permissions string. Then you can step through the list and pull
 only
  those files that don't start with a 'd'.  This requires more parsing
 and
  is less precise but is the only way I know to do it. I thought someone
  was writing an extension that did this automatically but don't know if
  it has made its way to CPAN.
 
  http://danconia.org
 
  --
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  http://learn.perl.org/ http://learn.perl.org/first-response
 
 
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 
 -
Visit our Internet site at http://www.reuters.com
 
 Get closer to the financial markets with Reuters Messaging - for more
 information and to register, visit http://www.reuters.com/messaging
 
 Any views expressed in this message are those of  the  individual
 sender,  except  where  the sender specifically states them to be
 the views of Reuters Ltd.
 
 
 
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Net::FTP Help !

2004-08-10 Thread Kelvin Wu
my @raw_list = $ftp-dir($remote_dir);
my @files;
for (@raw_list) {
  # Skip directory and symblink
  next if $_ =~ /^d|^l/;

  # Store file name
  if ($_ =~ /(.+)(\d\d:\d\d) (.+)/) {
next if ($2 eq '.' or $2 eq '..');
push @files, $2;
  }
}


On Mon, 9 Aug 2004 19:38:19 -0600, Wiggins d Anconia
[EMAIL PROTECTED] wrote:
 
  Hi Guys and Gals ,
 
   I'm new to perl ... Here is my problem ..
 
  I'm connecting fine to the remote computer and logging in fine .. what I
  want to do is  a get all files from the remote directory . Here is is a
  snippet of the code
 
  $ftp-cwd($remote_dir)
  or die cannot change working directory , $ftp-message;
 
  # show current directory
  $ftp-pwd();
 
 
  @all_files = $ftp-ls();
 
  print @all_files;
 
 
  foreach $file(@all_files) {
 
  $ftp-get($file)
  or die cannot get file, $ftp-message;
  }
 
 
 
  The problem is that the remote directory has a subdirectory in it so the
  array reads it in @all_files = $ftp-ls; so when I go to do a
  $ftp-get($file) it reads the subdirectory name into it as well so it
  bombs out saying it cannot find file BLAH BLAH ... is there a way to
  read the directory without the subdirectory in there .. just the files I
  want to get .
 
 
 
  Hope this is clear ..
 
 
 
 You can use the 'dir' method to get a long listing, which should include
 the permissions string. Then you can step through the list and pull only
 those files that don't start with a 'd'.  This requires more parsing and
 is less precise but is the only way I know to do it. I thought someone
 was writing an extension that did this automatically but don't know if
 it has made its way to CPAN.
 
 http://danconia.org
 
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: FTPing of files between remote servers.

2004-07-20 Thread Kelvin Wu
try $from_ftp-pasv_xfer($file, $to_ftp);
perldoc Net::FTP for details.


On Tue, 20 Jul 2004 09:09:49 -0400, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Could some suggest how can i transfer a file from one remote host to another
 remote host using FTP module. Is there any way of doing this . Please guide
 me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




2 Socket questions

2004-07-13 Thread Kelvin Wu
hello,


1, how to use http 1.1 via IO::Socket?

2, if i have a script like this:
connectserver();
answerserver();
closeserver ();

how to do a parallel processing while waiting for server response? use fork?

thanks.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Converting ASCII extended symbols to image

2004-07-07 Thread Kelvin Wu
i'm having troubles converting ascii extended symbols, for exaple one
of them looks like that '=DC' in win, but in unicode, or old ibm dos
extended ascii its black box. most of ascii art using this and sign
like that. what i'd like to do is create dynamic .png image with
content of some ascii file. i was thinking of using GD or ImageMagick,
plus a OEM-DOS font(with code page 437, something like old Terminal
font)... so far i have no luck, dunno how to map these symbols. anyone
can help on this?

thanks.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response