Re: [Perl-unix-users] Need help for regular expression problem

2009-12-08 Thread Matt Schneider
Walter, I have not tested this but I believe your problem is the greedy matching. It is matching from one { to the furthest } it can. I am guessing that \w is matching those internal }{ and the $ which I don't think it should but they might be ignored because they are generally meta characters.

Re: [Perl-unix-users] Perl Script for sending a mail

2009-02-17 Thread Matt Schneider
I actually use Mail::Sender and here is a sample of how. my $sender = new Mail::Sender({ smtp => "skyline", # smtp mail sever from => $from, # list of comma separated email addresses }); $sender->MailFile({ to => $to, # list of comma separated email addres

Re: [Perl-unix-users] '?' on a {} char length specification

2008-12-10 Thread Matt Schneider
See my comments bellow. I'm not sure it I helped or not but hopefully I at least clarified ?. Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, December 10, 2008 13:39 Cc: Perl-Unix-Users@listserv.act

Re: [Perl-unix-users] printing hash values in a special order

2007-04-09 Thread Matt Schneider
Perdeep, I think this code should do what you are looking for: # retool your data into something more usable, a hash of arrays foreach $key (keys %Values) { # split the values for the key @values = split(/\s/, $Values{$key}); foreach $val (@values) { # set this value in an ar

Re: [Perl-unix-users] Perl module stopping script from running??

2007-02-08 Thread Matt Schneider
Let me clarify. I didn't mean "system calls" but shell calls. Matt From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matt Schneider Sent: Thursday, February 08, 2007 1:06 PM To: Ben Eagle; perl-unix-users@listserv.ActiveState.

Re: [Perl-unix-users] Perl module stopping script from running??

2007-02-08 Thread Matt Schneider
Ben, If you make any system calls in your script you might be running into the same problem. Absolute paths will help there too. Matt From: Ben Eagle [mailto:[EMAIL PROTECTED] Sent: Thursday, February 08, 2007 12:36 PM To: Matt Schneider; perl-unix-users

Re: [Perl-unix-users] Perl module stopping script from running??

2007-02-08 Thread Matt Schneider
The path variable is probably different for the anonymous web user on Solaris. Can you add make it work by adding a use lib statement that tells the script where the module is installed? Something like: use lib '/usr/local/perl/lib/whatever'; Matt From:

Re: [Perl-unix-users] Regex question

2007-02-06 Thread Matt Schneider
Terry, Something like this should work. Note this is not tested. Here's a little explanation too. The '.' matches any character as you know and the '*' says any number of those any characters. The key is the '?' after the '*' which makes the match "non-greedy". Normally the '*' matches as

Re: [Perl-unix-users] How to parse a date string and convert it intomm/dd/yyyy format

2007-01-05 Thread Matt Schneider
You could try something like this: $data = '760434|c|061230'; ($date) = $data =~ m/^.\|(\d+)/; $date =~ s%(\d\d)(\d\d)(\d\d)%$2/$3/20$1%; Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of AITHA, BHEEMSEN (SBCSI) Sent: Friday, January 05, 2007 11:57 AM

Re: [Perl-unix-users] cron can't run perl properly?

2006-08-30 Thread Matt Schneider
The only thing that I see right off is that faxstat might not reside in a directory in the cron path. I have run into this before. You might try giving an absolute path and see if that works. Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Toddy

RE: [Perl-unix-users] Counting words

2006-04-26 Thread Matt Schneider
Title: Counting words Craig,   A fairly simple way to do this would be to open the file and step though it tracking the first words like this:   open FH, "the_file.txt"; foreach $line () {     # non-greed pattern match to get the first word on the line    ($first_word) = $line  =~ /^(\S+?)\s

RE: [Perl-unix-users] Sharing Variables among Processes...

2005-08-24 Thread Matt Schneider
Perhaps others might know better but to the best of my knowledge the fork command doesn't work that way.  The child and parent are two completely separate processes that don't share any resources.  What you are looking for is something more like threads where each thread can access shared

RE: [Perl-unix-users] regex numerical matching w/comma seperated listsupport

2005-06-10 Thread Matt Schneider
I changed your regular expression to this and it worked: $value =~ /^[0-9]+$|^[0-9][0-9,]*[0-9]$/ Matt Schneider -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, June 10, 2005 12:35 PM To: perl-unix-users

RE: [Perl-unix-users] XML::LibXML and UTF8 after perl upgrade

2005-04-20 Thread Matt Schneider
Just a stab in the dark but I have not like the way modules have worked before so I have gone into the installed module in /usr/lib/... and changed it there. You might see if that is feasible for your problem or there may be a way in the module already to set the output type. Matt Schneider

RE: [Perl-unix-users] Accessing mail from the web

2005-03-14 Thread Matt Schneider
Peter, Single quotes means to interpret whatever is between them literally. Therefore the $ that marks your variable is interpreted as only a dollar sign and not the start of a variable name. '$folder_name' is the same as saying "\$folder_name". Matthew Schneider System Admin / Programmer SKLD I

RE: [Perl-unix-users] Search string behaving strangely for null..?

2004-12-03 Thread Matt Schneider
I think you problem is in your if statement. See below. Matthew Schneider System Admin / Programmer SKLD Information Services, LLC 303-820-0863 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Avadhani, Subramanya Sent: Friday, December 03, 2004 4:37 AM T

RE: [Perl-unix-users] mkdir questions on unix platform

2004-11-15 Thread Matt Schneider
Lixin,   Perl's mkdir function does not do parent directory creation like the shell command "mkdir -p somedir".  I wrote a little function to get around this.   # make a directory and it's parent if necessarysub mkdirp {    my $dir = shift;    my $check;       # if something with this path al

RE: [Perl-unix-users] How to append specified files into a big file

2004-07-20 Thread Matt Schneider
In the shell I would run the following command:   cat Meas.atl00.1040.0710 Meas.atl00.1040.0711 Meas.atl00.1040.0712 Meas.atl00.1040.0713 Meas.atl00.1040.0714 Meas.atl00.1040.0715 Meas.atl00.1040.0716 > bigfile.txt   Thanks,Matthew SchneiderSystem Administrator / ProgrammerSKLD Informat

RE: [Perl-unix-users] sub all but last

2004-05-27 Thread Matt Schneider
It's not pretty or elegant but it does get the job done: $str = "abc.def.ghi.jkl.mno"; @parts = split /\./, $str; for ($i=0; $i<$#parts; $i++) { $new_str .= "$parts[$i]_"; } $new_str .= ".$parts[-1]"; Matthew Schneider System Administrator / Programmer SKLD Information Services, LLC 303.820.0

[Perl-unix-users] Timeouts

2004-05-27 Thread Matt Schneider
Does anyone know how to increase the timeout time for a soap transport over HTTP client session? I have looked around in all the soap modules and the HTTP modules too and can't find it anywhere. Matthew Schneider System Administrator / Programmer SKLD Information Services, LLC 303.820.0863 ___

RE: [Perl-unix-users] How to grab the output (return code) of a shellscript

2004-05-10 Thread Matt Schneider
You could do something like this: $check_return = system "runthis"; print "\'runthis\' exited with code \'$check_return\'\n" if ($check_return != 0); Matthew Schneider System Administrator / Programmer SKLD Information Services, LLC 303.820.0863 -Original Message- From: [EMAIL PROTECTED

RE: [Perl-unix-users] List

2004-04-19 Thread Matt Schneider
print "Hello there.\n"; Matt Schneider Programmer/System Administrator SKLD Information Services 303.820.0863 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gomez, Juan Sent: Monday, April 19, 2004 12:10 PM To: [EMAIL PROTECTED] Subject: [Perl-

RE: [Perl-unix-users] Some help with strings

2004-04-05 Thread Matt Schneider
I think what you are looking for is: $string =~ s/\|+/\|/g; Matthew Schneider System Administrator / Programmer SKLD Information Services, LLC 303.820.0863 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Johnno Sent: Monday, April 05, 2004 8:46 AM To: [EMA

RE: [Perl-unix-users] Capturing an evaluated pattern matching

2004-03-31 Thread Matt Schneider
I was able to get this to work by just doing normal regular expression matching. $stringFromFirstFile = "Test: trying to capture this part of the string"; $stringFromSecondFile = "^Test: (.*)"; ($capture) = $stringFromFirstFile =~ /$stringFromSecondFile/; print "$capture\n"; Matthew Schneider

RE: [Perl-unix-users] problem with profile.

2004-03-01 Thread Matt Schneider
Here is a sample line from my crontab where I do that exact thing 13 07-19 * * 0-6 . /home/grunt/.bash_profile; get_map_list.pl Matthew Schneider System Administrator / Programmer SKLD Information Services, LLC 303.820.0863 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTE

RE: [Perl-unix-users] Removing a set of consecutive file names from a directory

2003-12-01 Thread Matt Schneider
You could do something like this: # get a list of log files somehow @logs = `ls *.log`; # remove the new lines from the end of each element due to # the way I generated the list chomp @logs; # make sure the list is in order @logs = sort @logs; # remove all but the last 10 archive log files and the

RE: [Perl-unix-users] perl equivalent to "cut"

2003-06-10 Thread Matt Schneider
Title: perl equivalent to "cut" I'd do something like this   $string = "BLAH=VALUE ONE"; ($string) = $string =~ m/=(.+)$/; print "$string\n";   or   $string = "BLAH=VALUE ONE"; (@string) = split m/=/, $string; print "@string[1]\n"; Matthew Schneider System Administrator / Programmer SKLD Inform

RE: [Perl-unix-users] deleting "invisible" characters

2003-03-11 Thread Matt Schneider
at it will also remove anything like #, @, ^, *, etc. that might be in the string.  You could add those to the regular expression of course but I didn't want to go to the effort of adding every special character on the keyboard.   $string =~ /[^\w\s\d]//g Matt Schneider Programmer/Syste

RE: [Perl-unix-users] want to compare character in two files

2003-02-26 Thread Matt Schneider
variables in the two loops so just name the inner file handle LECTOR1 and that should fix it. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: Ing. Ricardo Cumberbatch L. (PANNet - URC) [mailto:[EMAIL PROTECTED] Sent: Tuesday

RE: [Perl-unix-users] Sentences that not working right

2003-02-18 Thread Matt Schneider
it should be when alphas are present. Other than that I'm not sure what might be the problem. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: Ing. Ricardo Cumberbatch L. (PANNet - URC) [mailto:[EMAIL PROTECTED]] Sent: Tuesd

RE: [Perl-unix-users] Perl script on Apache Unix server

2003-02-18 Thread Matt Schneider
"invisible" characters that make up the DOS new line and then write it to a new file with a "\n" on the end. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message-From: Martin Vernooij [mailto:[EMAIL PROTECTED]]Sent: Tuesday,

RE: [Perl-unix-users] Query on writing perl script to telnet to a HP m/c remotely

2003-01-29 Thread Matt Schneider
x27;t automatically disconnect you.  However, your Telnet server might have a low timeout and in that case you might want to periodically in that 3 minutes do a listing or something to keep the connection active. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Ori

RE: [Perl-unix-users] debugging option

2003-01-24 Thread Matt Schneider
familiar with because it has so many commands. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 1:44 PM To: [EMAIL PROTECTED] Subject: [Perl-unix-users

RE: [Perl-unix-users] Hash in win and Unix

2003-01-23 Thread Matt Schneider
After you read it in from a file do you chomp (@list_names)? If you don't then there is a "\n" on the end that the hash function will see and say that there is no data associated with that key. Perl Windows may automatically ignore this I don't know. Matt Schneide

RE: [Perl-unix-users] Trying to change some punctuation in a string

2003-01-23 Thread Matt Schneider
I would try $string2 = $string1; $string2 =~ s%[-\.]%/%; Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: Jon Shorie [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 8:27 AM To: [EMAIL PROTECTED] Subject: [Perl-unix

RE: [Perl-unix-users] Remote executing a script using perl

2003-01-23 Thread Matt Schneider
could use it to perform any operation that can be done in a Telnet session.  The same goes for the SSH module only it has security. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message-From: Mundell, R. (Ronald) [mailto:[EMAIL PROTECTED]

RE: [Perl-unix-users] Remote executing a script using perl

2003-01-23 Thread Matt Schneider
Title: Remote executing a script using perl Ronald,   I don't now your security requirements but you could try either the Telnet or SSH module. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message-From: Mundell, R. (Ronald) [m

RE: [Perl-unix-users] Perl and UNix

2003-01-22 Thread Matt Schneider
s 128 bit encryption so that whoever is sniffing your data will not be able to get anything out of it unless they have a 18-wheeler full of supercomputers to work on it. If you are just going across your internal LAN you shouldn't have any problem using Telnet unless you have internal s

RE: [Perl-unix-users] Perl and UNix

2003-01-20 Thread Matt Schneider
much more work than it is worth with quicker solutions out there. Although once written it might be the most efficient. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]] Sent: Mon

RE: [Perl-unix-users] Perl and UNix

2003-01-20 Thread Matt Schneider
overhead. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC -Original Message- From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]] Sent: Monday, January 20, 2003 1:35 PM To: '[EMAIL PROTECTED]' Subject: [Perl-unix-users] Perl and UNix Hi al

RE: [Perl-unix-users] Environment variables

2002-12-20 Thread Matt Schneider
plit(/:/, $PATH); or modify it any way you like:$PATH .= ":."; To remove a tied environment variable from the environment, make it the undefined value:undef $PATH; Note that the corresponding operation performed directly against %ENV is not undef, but delete:delete $ENV{PATH}; Ma

RE: [Perl-unix-users] File Renaming

2002-11-14 Thread Matt Schneider
I would run this from the command line in that directory: perl -e 'foreach $oldfile (<*>) { $newfile = "\L$oldfile"; rename $oldfile, $newfile; }' the \L in the quotes forces everything after it in the quotes to be lowercase. Matt Schneider Programmer/System Admin

RE: [Perl-unix-users] regexp Q

2002-11-12 Thread Matt Schneider
Terry, Try this: ($mytempvar) = $linetoprobe =~ m/(.)...$/; Putting $mytempvar in the () assigns it the character in the () in the regular expression match where a "." will match any character. Matt Schneider Programmer/System Administrator SKLD Information Services, LLC (