From Rob_Manning at mail.ci.baltimore.md.us Wed Nov 3 10:11:27 1999 From: Rob_Manning at mail.ci.baltimore.md.us (Manning, Rob) Date: Wed Aug 4 23:57:33 2004 Subject: Your 'value added combination example' Message-ID: <118CFE9A2035D111AE7B0060081C7513619DB6@finance.ci.baltimore.md.us> -----Original Message----- From: James W. Sandoz; (BIO;FAC) [SMTP:sandoz@umbc.edu] Sent: Wednesday, November 03, 1999 8:47 AM To: Rob Manning Subject: Your 'value added combination example' Rob, A quicker way may be to use the -s filetest :foreach my $file(@files) { $filesize = -s $_; etc Just butting in... Jim Mr. James W. Sandoz, Instructor, UMBC Dept of Biol Sciences, 1000 Hilltop Circle Catonsville, MD 21250 voice: (410) 455-3497; fax: 455-3875; net: sandoz@umbc.edu Jim, These filenames are the result of an 'ls' in a directory on a remote machine, if you're talking about the array @files generated by these lines my $t = Net::Telnet->new( Timeout => 10,Prompt => '/' . $shell_prompt . '/' , Host => $host); $t->login($user, $pass) or die "Login failed: @{[$t->errmsg() ]}\n"; my @files = $t->cmd('ls -l' . $filename); If so then the -s file test operator should always return "undefined" for files that do not exist - the files in the @files do not exist on the machine that the perl script is executing on. They only exist on the remote machine and we happen to see them because we're using the 'cmd' method to run the "ls -l" command remotely via our telnet object which is connected to that remote machine. If we were to do a system('ls -l' . $filename) from this perl script we should get an empty array unless the file actually exists on the local machine as well. But our intent was to get the size of the file on the remote machine. Now someone pointed out that we could use a perl one-liner as the argument to the call to "cmd" as in $cmd = 'perl -e ' . "'" . 'print -s (' . '"' . $filename . '"' . ');' . "'"; my @files = $t->cmd($cmd); This actually works when I use it with telnet on a different UNIX server(still Solaris 2.6), it's just that we haven't installed Perl on our database server - dunedin - yet. So maybe I'll have to implement the brute force Perl installation solution that Ken Cline recommended last night to make the script a bit more robust! I'll let you know when perl_world_domination.pl is ready! :-) Thanks for the reponse! Rob Rob Manning manningr@tcsnet.net Senior Systems Analyst Work (410) 396-4963 TeleCommunication Systems Fax (410) 837-0546 -- Looking for a Perl user's group in Baltimore? - http://baltimore.pm.org From sandoz at umbc.edu Wed Nov 3 12:47:56 1999 From: sandoz at umbc.edu (James W. Sandoz; (BIO;FAC)) Date: Wed Aug 4 23:57:33 2004 Subject: Your 'value added combination example' In-Reply-To: <118CFE9A2035D111AE7B0060081C7513619DB6@finance.ci.baltimore.md.us> Message-ID: > These filenames are the result of an 'ls' in a directory > on a remote machine, if you're talking about the array > @files generated by these lines Got it. My advice was offered without my closely examing the whole script. It was therefore (as you gently pointed out) useless. However, if this does result in the forced install of Perl...... Jim Mr. James W. Sandoz, Instructor, UMBC Dept of Biol Sciences, 1000 Hilltop Circle Catonsville, MD 21250 voice: (410) 455-3497; fax: 455-3875; net: sandoz@umbc.edu From rmanning at erols.com Fri Nov 12 05:43:41 1999 From: rmanning at erols.com (Rob Manning) Date: Wed Aug 4 23:57:33 2004 Subject: New Baltimore PM meeting place Message-ID: <382BFD6D.3152A4BF@erols.com> Over the last few months I've been looking at alternatives to the meeting place the group currently has "The Daily Grind". This is due to a number of members having approached me and said that the background noise from the music and cappuccino machine make it difficult to hear what's being said by the speaker. At the last meeting David Waldo of Community of Science in Fells Point graciously offered the use of his company's conference room which readily accommodates 15-20 people, has an Internet connection with a computer and projector, and provides a quiet setting for us to gather, even past 9:00 p.m. I met with him yesterday and he introduced me to the CEO of his company who was in favor of having us. Unless there are compelling reasons not to, I propose we meet at Community of Science conference room on December 7 with the intent that if the group finds it suitable, it will become our new monthly meeting spot. Directions to COS can be found at http://www.cos.com/directions.html. Parking can be found on the street (Thames St.) in front of the building, or for $2 you can park in the parking lot at the end of the building. David also says it is o.k. for us to bring food/drink into the building and conference room. In addition, we're still looking for someone to give a talk for the December 7 meeting. It can be on any perl topic you are comfortable speaking about including current projects you're working on. If anyone is interested send me email. Rob From sandoz at umbc.edu Fri Nov 12 06:06:46 1999 From: sandoz at umbc.edu (James W. Sandoz; (BIO;FAC)) Date: Wed Aug 4 23:57:33 2004 Subject: New Baltimore PM meeting place In-Reply-To: <382BFD6D.3152A4BF@erols.com> Message-ID: > spot. Directions to COS can be found at > http://www.cos.com/directions.html. Parking can be found on I just tried it. It's http://www.cos.com/directions.shtml Looking forward to the Dec 7 meeting there. Jim Mr. James W. Sandoz, Instructor, UMBC Dept of Biol Sciences, 1000 Hilltop Circle Catonsville, MD 21250 voice: (410) 455-3497; fax: 455-3875; net: sandoz@umbc.edu From freter at freter.com Thu Nov 25 12:35:10 1999 From: freter at freter.com (Craig Freter) Date: Wed Aug 4 23:57:33 2004 Subject: mail attachments Message-ID: <383D815E.C82500FF@admc.com> All, I just wrote a test program to send multiple mail attachments. I thought perhaps the Baltimore PM list might find it interesting. #!/usr/local/bin/perl -w use strict; use MIME::Base64; # system programs my $mail_prog = "/usr/lib/sendmail -t"; # create Base64 encoded message my $message = 'This is a Base64 encoded message'; my $encoded = encode_base64($message); # fork sendmail open MAIL, "| $mail_prog" or die "can't fork $mail_prog"; print MAIL <