QUOTE |
Does anyone see anything logically wrong with my code b/c I am still not receiving the correct data in the email. The data is a # 1 when it should be a listing of Exxxxx strings. thank you! ## Set pragmas use strict; use MIME::Lite; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PATH'} = "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin"; #print $ENV{'PATH'},"n"; ## Traverse through array and play with data open (OUT, ">$foreigntapes") || die "could not open file:$!"; my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`; print OUT "@ftapes"; #if ( -s @ftapes ) { my $msg = MIME::Lite->new( From => 'EDM01 <[Email Removed]>', To => 'Derek Smith <[Email Removed]>', Subject => "Foreign Tapes Found, now attmepting to label", Data => print "@ftapes" ); |
QUOTE |
msg->send; |
QUOTE |
-----Original Message----- From: [Email Removed] [mailto:[Email Removed]] Sent: Friday, June 04, 2004 1:42 PM To: [Email Removed] Subject: RE:mime lite Does anyone see anything logically wrong with my code b/c I am still not receiving the correct data in the email. The data is a # 1 when it should be a listing of Exxxxx strings. thank you! ## Set pragmas use strict; use MIME::Lite; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PATH'} > "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin"; #print $ENV{'PATH'},"n"; ## Traverse through array and play with data open (OUT, ">$foreigntapes") || die "could not open file:$!"; my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`; print OUT "@ftapes"; #if ( -s @ftapes ) { my $msg = MIME::Lite->new( From => 'EDM01 <[Email Removed]>', To => 'Derek Smith <[Email Removed]>', Subject => "Foreign Tapes Found, now attmepting to label", Data => print "@ftapes" Change this line to read |
QUOTE |
msg->send; #foreach (@ftapes) { #print $_; #`evmlabel -l st_9840_acs_0 -t 9840S -b$_` #} close (OUT); #} else { # my $foo="/tmp/ftapes_runfile"; # open (RUNFILE, ">$foo") || die "could not open runfile: $!;" #} #close (RUNFILE); Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams <[Email Removed] 06/04/2004 10:58 AM Please respond to cslyon To: <[Email Removed]>, <[Email Removed] cc: Subject: RE: sendmail -----Original Message----- From: [Email Removed] [mailto:[Email Removed]] Sent: Friday, June 04, 2004 6:39 AM To: [Email Removed] Subject: sendmail ok here it what I did and it is emailing sporadically or not at all??? Also it is not placing the array data into the email body??? it is like the if clause it not working. thank you! ## Set pragmas use strict; use Mail::Sendmail; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PATH'} > > "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin"; #print $ENV{'PATH'},"n"; ## Traverse through array and play with data open (OUT, ">$foreigntapes") || die "could not open file:$!"; my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`; print OUT "@ftapes"; I would try to test something else besides the handle. I know you can do these types of tests against a file but a handle? Not sure if that is the best way to do it. Besides, you are testing if the file exists and have a nonzero size against a handle. Test the array maybe? if ( -s OUT ) { my %mailman = ( From => 'EDM01 <[Email Removed]>', To => 'Derek Smith <[Email Removed]>', Subject => "Foreign Tapes Found, now attmepting to label" , Message => print OUT "@ftapes" ); Try this for the Message line instead: Message => "@ftapes" ); You might also want to try MIME::Lite for sending this. I know there is a bunch of discussion about Mail::Sendmail and having it work correctly and everybody recommends MIME::Lite instead. I was using Mail::Sendmail for a bunch of things and moved everything over to MIME::Lite. Works like a charm! sendmail (%mailman) or die $Mail::Sendmail::error; foreach (@ftapes) { print $_; #`evmlabel -l st_9840_acs_0 -t 9840S -b$_` } close (OUT); } else { my $foo="/tmp/ftapes_runfile"; open (RUNFILE, ">$foo") || die "could not open runfile: $!;" #exit 0; } close (RUNFILE); derek -- To unsubscribe, e-mail: [Email Removed] For additional commands, e-mail: [Email Removed] <http://learn.perl.org/> <http://learn.perl.org/first-response |
QUOTE |
-----Original Message----- From: [Email Removed] [mailto:[Email Removed]] Sent: Friday, June 04, 2004 1:42 PM To: [Email Removed] Subject: RE:mime lite Does anyone see anything logically wrong with my code b/c I am still not receiving the correct data in the email. The data is a # 1 when it should be a listing of Exxxxx strings. thank you! ## Set pragmas use strict; use MIME::Lite; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PATH'} = "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin"; #print $ENV{'PATH'},"n"; ## Traverse through array and play with data open (OUT, ">$foreigntapes") || die "could not open file:$!"; my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`; print OUT "@ftapes"; #if ( -s @ftapes ) { my $msg = MIME::Lite->new( From => 'EDM01 <[Email Removed]>', To => 'Derek Smith <[Email Removed]>', Subject => "Foreign Tapes Found, now attmepting to label", Data => print "@ftapes" ); Change this line to read |
QUOTE |
msg->send; #foreach (@ftapes) { #print $_; #`evmlabel -l st_9840_acs_0 -t 9840S -b$_` #} close (OUT); #} else { # my $foo="/tmp/ftapes_runfile"; # open (RUNFILE, ">$foo") || die "could not open runfile: $!;" #} #close (RUNFILE); Derek B. Smith OhioHealth IT UNIX / TSM / EDM Teams <[Email Removed] 06/04/2004 10:58 AM Please respond to cslyon To: <[Email Removed]>, <[Email Removed] cc: Subject: RE: sendmail -----Original Message----- From: [Email Removed] [mailto:[Email Removed]] Sent: Friday, June 04, 2004 6:39 AM To: [Email Removed] Subject: sendmail ok here it what I did and it is emailing sporadically or not at all??? Also it is not placing the array data into the email body??? it is like the if clause it not working. thank you! ## Set pragmas use strict; use Mail::Sendmail; ## Set and edit variables my $foreigntapes="/usr/local/log/foreign_tapes.log"; delete $ENV{'IFS'}; local $ENV{'PATH'} = "/usr/epoch/bin:/usr/epoch/EB/bin:/usr/bin:/usr/sbin:/bin:/sbin"; #print $ENV{'PATH'},"n"; ## Traverse through array and play with data open (OUT, ">$foreigntapes") || die "could not open file:$!"; my @ftapes = grep s/^barcode=//, `evmvol -w label_state=1`; print OUT "@ftapes"; I would try to test something else besides the handle. I know you can do these types of tests against a file but a handle? Not sure if that is the best way to do it. Besides, you are testing if the file exists and have a nonzero size against a handle. Test the array maybe? if ( -s OUT ) { my %mailman = ( From => 'EDM01 <[Email Removed]>', To => 'Derek Smith <[Email Removed]>', Subject => "Foreign Tapes Found, now attmepting to label" , Message => print OUT "@ftapes" ); Try this for the Message line instead: Message => "@ftapes" ); You might also want to try MIME::Lite for sending this. I know there is a bunch of discussion about Mail::Sendmail and having it work correctly and everybody recommends MIME::Lite instead. I was using Mail::Sendmail for a bunch of things and moved everything over to MIME::Lite. Works like a charm! sendmail (%mailman) or die $Mail::Sendmail::error; foreach (@ftapes) { print $_; #`evmlabel -l st_9840_acs_0 -t 9840S -b$_` } close (OUT); } else { my $foo="/tmp/ftapes_runfile"; open (RUNFILE, ">$foo") || die "could not open runfile: $!;" #exit 0; } close (RUNFILE); derek -- To unsubscribe, e-mail: [Email Removed] For additional commands, e-mail: [Email Removed] <http://learn.perl.org/> <http://learn.perl.org/first-response |
QUOTE |
hi, i have to blast genes of human Y chromosome(104 genes)with genomes of non human species to find which genes are conserved on Y and on non-Y chromosomes in other species.and for each gene,its chromosome its 5' and 3'end location w.r.t. human Y gene and similarity percentage is also required. if done manually,it would amount for over 3000 blasts.it would be of great help if anyone could tell me the link to a perl script or similar script , if available. thanking you, aditi |
QUOTE |
I didn't really know where to post this since it isn't specifically Apache or Perl, so I'm posting here....just because :) I run 2 vhosts under Apache 1.3.29 (needed for mod_perl-1.x which is needed by HTML::Mason) on my Gentoo server. One vhost is the current production site and the other vhost is the development version of the site. I use a custom Perl module for authentication and other common functions for all my Perl CGI/mod_perl scripts. I want to be able to make changes to the module, but I only want it to affect the second vhost. Basically, I need to have 2 copies of my custom module, one for each vhost. Is there an easy way to do this? |
QUOTE |
hi, |
QUOTE |
vi is used only in unix and linux. |
QUOTE |
which editor can be used in windows and is better than notepad. |
QUOTE |
I will end up having more than 2 vhosts, most of which will need a custom version of this particular module. |
QUOTE |
Andrew Gaffney wrote: I didn't really know where to post this since it isn't specifically Apache or Perl, so I'm posting here....just because :) I run 2 vhosts under Apache 1.3.29 (needed for mod_perl-1.x which is needed by HTML::Mason) on my Gentoo server. One vhost is the current production site and the other vhost is the development version of the site. I use a custom Perl module for authentication and other common functions for all my Perl CGI/mod_perl scripts. I want to be able to make changes to the module, but I only want it to affect the second vhost. Basically, I need to have 2 copies of my custom module, one for each vhost. Is there an easy way to do this? If you have only one instance of Apache, I think the answer is no. The multiple virtual hosts still share the single perl interpreter. Why not just run two instances of Apache and put your development version on the second (listen on port 8080 or some such)? |
QUOTE |
hi all, can anyone tel me how to look for files which conatain dotsin it. i.e file1.txt file2.txt how to check for dots in filename using regular expression. is it correct my $ty=polica.op if($ty =m/ (.*).o/) |
QUOTE |
print found; plz reply soon sid --------------------------------------------------------------------------------------------------------------------------------- "There is nothing in a caterpillar that tells you it's going to be a butterfly." - Anonymous ********************************************* Sidharth M Patil Engineer Kyocera-Wireless (India) Pvt Ltd 5th Floor, Phase I, Divyashree Towers, Guruppanapalya, Bannerghatta Road, Bangalore-560072 Tel : 51106988 extn 5171 ********************************************* |
QUOTE |
Andrew Gaffney wrote: I will end up having more than 2 vhosts, most of which will need a custom version of this particular module. In that case, I think you'll need to give the modules different names. You could write your handler in such a way that it would recompile the module (switching flavors) with each request, but that would kind of defeat the purpose of mod_perl... |
QUOTE |
hi all, can anyone tel me how to look for files which conatain dotsin it. i.e file1.txt file2.txt how to check for dots in filename using regular expression. is it correct my $ty=polica.op if($ty =m/ (.*).o/) The regular expresion should be /(.*).o/. Otherwise you'll try to match a filename beginning with a space. |
QUOTE |
Hi There, Any pointers to how to call "more" on a file in perl script. I am writing one script which displays one report to user and then asks some inputs. User need to see complete file. To solve this, I thought I can call `more in the script and continue. But looks loke it is not possible. |
QUOTE |
Hi, I have a rather simple question that Google hasn't produced answers for. Basically, I am installing Mason in a virtual host under mod_perl. The libraries I need are housed in ~/my/lib |
QUOTE |
How might I make Apache aware of ~/my/lib from the httpd.conf so that the following: PerlModule HTML::Mason::ApacheHandler will load? What is the equivalent for the httpd.conf of use lib('/my/lib'); ? |
QUOTE |
I'm in the process of learning perl (hmm - right at the beginning of this process), and I'm having great difficulty working my way through the man pages. I'm a Windows user and perl is the first language I'm learning, so *everything* is new to me. I am also having to get to grips with using my shell account which is just adding to the difficulties. What would really make my life easier right now is a glossary of programming specific terms so that I'm not struggling to find meanings for the terminology used in some of the man pages (specifically I'm trying to work my way through man screen) every other word. Does such a glossary exist? I'm aware of the Jargon Files and I'm aware that many of these terms have man pages of their own (but my entire reason for reading man screen is to learn how to have different windows open with different things going on in each window!). Thank you for all your help, |
QUOTE |
chomp for @array; # trim "n" at the end |
QUOTE |
What I usually do is directly try installing the modules required , say LWP Try sudo perl -MCPAN -e 'install LWP' HTH Ram On Thu, 2004-06-10 at 07:32, philcalvert wrote: Hi All, I've been trying to install a module and haven't been having much luck. Here's what I get; thatsme-Computer:~ thatsme$ sudo perl -MCPAN -e 'install libwww-perl' CPAN: Storable loaded ok Going to read /Users/thatsme/.cpan/Metadata Database was generated on Wed, 09 Jun 2004 23:34:22 GMT Warning: Cannot install 0, don't know what it is. Try the command i /0/ to find objects with matching identifiers. Thanks for any help in advance. --Phil --Phil Calvert |
QUOTE |
Hi All, I've been trying to install a module and haven't been having much luck. Here's what I get; thatsme-Computer:~ thatsme$ sudo perl -MCPAN -e 'install libwww-perl' CPAN: Storable loaded ok Going to read /Users/thatsme/.cpan/Metadata Database was generated on Wed, 09 Jun 2004 23:34:22 GMT Warning: Cannot install 0, don't know what it is. Try the command i /0/ to find objects with matching identifiers. Thanks for any help in advance. --Phil |
QUOTE |
Sorry, That does not seem to work Try this instead perl -MCPAN -e 'CPAN::install LWP' On Thu, 2004-06-10 at 10:37, Ramprasad A Padmanabhan wrote: What I usually do is directly try installing the modules required , say LWP Try sudo perl -MCPAN -e 'install LWP' HTH Ram On Thu, 2004-06-10 at 07:32, philcalvert wrote: Hi All, I've been trying to install a module and haven't been having much luck. Here's what I get; thatsme-Computer:~ thatsme$ sudo perl -MCPAN -e 'install libwww-perl' CPAN: Storable loaded ok Going to read /Users/thatsme/.cpan/Metadata Database was generated on Wed, 09 Jun 2004 23:34:22 GMT Warning: Cannot install 0, don't know what it is. Try the command i /0/ to find objects with matching identifiers. Thanks for any help in advance. --Phil |
QUOTE |
What I usually do is directly try installing the modules required , say LWP Try sudo perl -MCPAN -e 'install LWP' HTH Ram On Thu, 2004-06-10 at 07:32, philcalvert wrote: Hi All, I've been trying to install a module and haven't been having much luck. Here's what I get; thatsme-Computer:~ thatsme$ sudo perl -MCPAN -e 'install libwww-perl' CPAN: Storable loaded ok Going to read /Users/thatsme/.cpan/Metadata Database was generated on Wed, 09 Jun 2004 23:34:22 GMT Warning: Cannot install 0, don't know what it is. Try the command i /0/ to find objects with matching identifiers. Thanks for any help in advance. --Phil |
QUOTE |
Sorry, That does not seem to work Try this instead perl -MCPAN -e 'CPAN::install LWP' On Thu, 2004-06-10 at 10:37, Ramprasad A Padmanabhan wrote: What I usually do is directly try installing the modules required , say LWP Try sudo perl -MCPAN -e 'install LWP' HTH Ram On Thu, 2004-06-10 at 07:32, philcalvert wrote: Hi All, I've been trying to install a module and haven't been having much luck. Here's what I get; thatsme-Computer:~ thatsme$ sudo perl -MCPAN -e 'install libwww-perl' CPAN: Storable loaded ok Going to read /Users/thatsme/.cpan/Metadata Database was generated on Wed, 09 Jun 2004 23:34:22 GMT Warning: Cannot install 0, don't know what it is. Try the command i /0/ to find objects with matching identifiers. Thanks for any help in advance. --Phil --Phil Calvert |
QUOTE |
Hello all. Can someone tell me what is the difference in the various ways to FETCH data from a database? I bought like 3 books and they don't really go in depth with the reasons why there are several of them, and what happens if you interchange them with different scenarios. |
QUOTE |
Here are the ones that I am asking about: Fetch Fetchrow Fetchrow_array fetchall_arrayref fetchrow_hashref |
QUOTE |
OK, after poking around a bit it seems that the the developer tools need to be installed. Having done that I now get this after running the line perl -MCPAN -e 'CPAN::install LWP' |
QUOTE |
On Jun 10, 2004, at 9:39 AM, Phil Calvert wrote: OK, after poking around a bit it seems that the the developer tools need to be installed. Having done that I now get this after running the line perl -MCPAN -e 'CPAN::install LWP' Try: sudo perl -MCPAN -e 'install LWP' You'll need to give the admin password for this. James --Phil Calvert |
QUOTE |
Hello, Thanks for the reply. When I try that I get; Can't locate object method "install" via package "LWP" at -e line 1. I should also say that I tried "sudo perl -MCPAN -e 'CPAN::install LWP'" and got the result that I reported previously. |
QUOTE |
On Jun 10, 2004, at 11:15 AM, Phil Calvert wrote: Hello, Thanks for the reply. When I try that I get; Can't locate object method "install" via package "LWP" at -e line 1. I should also say that I tried "sudo perl -MCPAN -e 'CPAN::install LWP'" and got the result that I reported previously. You might try taking this question to the Mac OS X Perl mailing list. http://lists.perl.org/showlist.cgi?name=macosx This is right up their alley and they're pretty helpful. Sorry I couldn't be more help. James --Phil Calvert |
QUOTE |
You can use the -d file test to check if the file is a directory before moving it. unless(-d $whatever_file){ do whatever... -----Original Message----- From: "Shu Hung (樹雄)" [mailto:[Email Removed]] Sent: Fri 6/11/2004 3:50 AM To: Perl Beginner Mail Group Cc: Subject: search and move 'expired files' Hello all, I want a script to move all 'expired files' to a folder. So I wrote the script below. However, a problem came out: the find function run everything in the address, including the entire folders structure!!! |
QUOTE |
Hello everyone. I tried to post this already to googlegroups but it seems there must be something wrong since I didnt get any replies (maybe I did something wrong). So, here's the deal. I am starting to use Maketext for a Website and i have the following situation: Supose english is my default language so all my calls look like this: $out = maketext("You won [quant,_1,point]"); Now, for every different language, I want to know if this text is not translated yet. Right now, if that key is missing on my french lexicon the text in english is being returned without throwing any kind of exception. Actually, if I understand correctly, it is supposed to work that way.... right? http://www.perldoc.com/perl5.8.0/lib/Local...TROLLING-LOOKUP -FAILURE If so, what's your advice? Would it be easy to override the maketext method so I can log this missing entries? Thank you very much, Andrs |
QUOTE |
I have some experience using perl, but I'm having a hard time finding or building a sane perl interpreter for my particular machine. For example, perl -e "print 1.1" yields something like 1.108333333. This was true both of the 5.8.0 that came with my Red Hat 8.0 distro, and the 5.8.2 that I built from source using defaults. The two builds give different results for the "print 1.1" test, but they are both wrong. |
QUOTE |
I imagine it's quite possible that something is deeply broken in Red Hat 8.0, and I'm investigating other more recent distros. In particular I wonder if something about my gcc or my glibc is screwy. But if anyone has encountered this problem, and has ideas on how I might work around it, I'd greatly appreciate the help! |
QUOTE |
Here is the output of myconfig for the 5.8.2 that I built (which did compile successfully): |
QUOTE |
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration: Platform: osname=linux, osvers=2.4.18-14, archname=i686-linux uname='linux swami 2.4.18-14 #1 wed sep 4 13:35:50 edt 2002 i686 i686 i386 gnulinux ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3', cppflags='-fno-strict-aliasing' ccversion='', gccversion='3.2 20020903 (Red Hat Linux 8.0 3.2-7)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.2.93.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.93' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' |
QUOTE |
Thanks in advance for your kind help. For the following string: "uuuu axyzb oooo cxyzd vvvv" What is the command to extract the substrings with "xyz" in them? In this case, I'd like to get two strings "axyzb" and "cxyzd". --------------------------------- Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! |
QUOTE |
I have some experience using perl, but I'm having a hard time finding or building a sane perl interpreter for my particular machine. For example, perl -e "print 1.1" yields something like 1.108333333. This was true both of the 5.8.0 that came with my Red Hat 8.0 distro, and the 5.8.2 that I built from source using defaults. The two builds give different results for the "print 1.1" test, but they are both wrong. |
QUOTE |
I imagine it's quite possible that something is deeply broken in Red Hat 8.0, and I'm investigating other more recent distros. In particular I wonder if something about my gcc or my glibc is screwy. But if anyone has encountered this problem, and has ideas on how I might work around it, I'd greatly appreciate the help! |
QUOTE |
Here is the output of myconfig for the 5.8.2 that I built (which did compile successfully): |
QUOTE |
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration: Platform: osname=linux, osvers=2.4.18-14, archname=i686-linux uname='linux swami 2.4.18-14 #1 wed sep 4 13:35:50 edt 2002 i686 i686 i386 gnulinux ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O3', cppflags='-fno-strict-aliasing' ccversion='', gccversion='3.2 20020903 (Red Hat Linux 8.0 3.2-7)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.2.93.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.93' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' |
QUOTE |
Hello All, I was wondering if there any module in perl which will let me add dates taking care of all the complications (i.e.,) if day is greater than 30 change month and so on. |
QUOTE |
For the following string: "uuuu axyzb oooo cxyzd vvvv" What is the command to extract the substrings with "xyz" in them? In this case, I'd like to get two strings "axyzb" and "cxyzd". |
QUOTE |
For the following string: "uuuu axyzb oooo cxyzd vvvv" What is the command to extract the substrings with "xyz" in them? In this case, I'd like to get two strings "axyzb" and "cxyzd". |
QUOTE |
One more question, how do I strip out all letters before "xyz". For the original example, how would I get "xyzb" and "xyzd"? |
QUOTE |
Thanks in advance for your kind help. For the following string: "uuuu axyzb oooo cxyzd vvvv" What is the command to extract the substrings with "xyz" in them? In this case, I'd like to >get two strings "axyzb" and "cxyzd". |
QUOTE |
For the following string: "uuuu axyzb oooo cxyzd vvvv" What is the command to extract the substrings with "xyz" in them? In this case, I'd like to get two strings "axyzb" and "cxyzd". |
QUOTE |
URL? thanks in advance Richard L. Roberts Systems Integrator Marine Corps Community Services 3044 Catlin Ave. Quantico, Va. 22134 Phone: Fax: Email: [Email Removed] -----Original Message----- From: Ciemny, Jessica [mailto:[Email Removed]] Sent: Wednesday, June 16, 2004 9:01 AM To: [Email Removed] Subject: Helpful Regular Expression Tool I am not sure if anyone has ever mentioned this before, but I wanted to share something with you that I have recently found that might be of great assistance with many of your "RegEx" issues. The name of this program is, "The Regex Coach". I have found it to be an invaluable tool to any regular expression building that I attempt to create. Input the information you are attempting to match in one pane of the window, then build your regular expression in the other pane, and watch how your expression matches up as you build it. Keep in mind that you still have to know the rules of regular expressions to build them. "The Regex Coach" does not build them for you; it just shows you how your regular expressions match up with the data that you supply it. Try it, it may or may not be helpful for you. Jessica Ciemny Sr. Unix System Administrator Global Information Technology ________________________________________ LSG Sky Chefs International, L.L.C. Global Information Services, Americas Data Center 1950 N Stemmons Fwy. Suite 2023 Dallas, TX 75027 United States of America Phone: + Fax: + Mobile: + E-mail: [Email Removed] ________________________________________ http://www.lsg-skychefs.com This electronic message transmission contains information from the Company LSG Sky Chefs or one of its affiliates which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. Any views or opinions presented are solely those of the author and do not necessarily represent those of LSG Sky Chefs. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by telephone or by electronic mail immediately. |
QUOTE |
Ah good point, I believe I forgot the line: $days_in_month[1] = 29 if $printed_year % 4 == 0; Better? If not apologies, not sure why that would be :) |
QUOTE |
-----Original Message----- From: Wiggins d'Anconia [mailto:[Email Removed]] Sent: 16 June 2004 01:18 To: [Email Removed] Cc: [Email Removed]; 'Mandar Rahurkar' Subject: Re: Time Your script appears to break every 4th year.... http://danconia.org Chris Welch wrote: The attached text file is an example of a calendar I've used for CGI purposes (I should point out this is not entirely my script, it's modified by me but the original was by a friend of mine.) -----Original Message----- From: Mandar Rahurkar [mailto:[Email Removed]] Sent: 15 June 2004 23:22 Cc: [Email Removed] Subject: Time Hello All, I was wondering if there any module in perl which will let me add dates taking care of all the complications (i.e.,) if day is greater than 30 change month and so on. Thanks, Mandar ------------------------------------------------------------------------ #! C:webperlbinperl.exe require("../admin/mkttl.conf"); use CGI; use Time::Local; ## from DMYHMS to epoch $q = new CGI; (my $true_sec, my $true_min, my $true_hour, my $true_mday, my $true_mon, my $true_year, my $true_wday, my $true_yday, my $true_isdst) = localtime(time); $days_in_month[0] = 31; $days_in_month[1] = 28; $days_in_month[2] = 31; $days_in_month[3] = 30; $days_in_month[4] = 31; $days_in_month[5] = 30; $days_in_month[6] = 31; $days_in_month[7] = 31; $days_in_month[8] = 30; $days_in_month[9] = 31; $days_in_month[10] = 30; $days_in_month[11] = 31; $months[0] = 'January'; $months[1] = 'February'; $months[2] = 'March'; $months[3] = 'April'; $months[4] = 'May'; $months[5] = 'June'; $months[6] = 'July'; $months[7] = 'August'; $months[8] = 'September'; $months[9] = 'October'; $months[10] = 'November'; $months[11] = 'December'; $days[0] = 'Sunday'; $days[1] = 'Monday'; $days[2] = 'Tuesday'; $days[3] = 'Wednesday'; $days[4] = 'Thursday'; $days[5] = 'Friday'; $days[6] = 'Saturday'; # The calendar $mon = ($q->param("month") - 1); $year = ($q->param("year")) if ($q->param("year")); $year = $true_year if ($year eq ""); # Use today's date if none are specified $mon = $true_mon if ($mon == -1); $todays_day_of_month = $true_mday if ($true_mon eq $mon && $true_year eq $year); my $first_day_of_month_epoch = timelocal(1, 0, 0,1, $mon, $year); (my $sec, my $min, my $hour, my $mday, my $mon, my $year, my $wday, my $yday, my $isdst) = localtime($first_day_of_month_epoch); $inset_month = $wday - 1; $inset_month = 6 if ($inset_month < 0); print "<table border='0' cellspacing='1' cellpadding='1' class='calendar' align='right' <tr <td colspan='7' align='center' class='cal_head' <table border='0' width='100%' cellpadding='0' cellspacing='0' class='month_header'><tr><td width='10' align='left'><b><a class='bold' href='"; ## define previous and next months and years $prev_month = $mon; $prev_year = $year; if ($prev_month eq 0) { $prev_month = 12; $prev_year--; } $next_month = ($mon+2); $next_year = $year; if ($next_month eq 13) { $next_month = 1; $next_year++; } "main.cgi?month=".$prev_month."&year=".$prev_year."'>«</a></b></td < td width='*' align='center'><a class='bold' href='main.cgi'>".$months[$mon]." ".($year + 1900)."</a></td><td width='10' align='right'><b><a class='bold' href='main.cgi?month=".$next_month."&year=".$next_year."'>»</a></b < /td></tr></table </td </tr <tr <td class='day_of_week'>M</td <td class='day_of_week'>T</td <td class='day_of_week'>W</td <td class='day_of_week'>T</td <td class='day_of_week'>F</td <td class='day_of_week'>S</td <td class='day_of_week'>S</td </tr>n"; $day_position_counter = 0; $day_number_counter = 1; $final_day_number = $days_in_month[$mon]; ## first create inset $i = 0; while ($i < $inset_month){ print " <tr>n" if $day_position_counter == 0; print " <td> </td>n"; $day_position_counter++; $i++; } ## now create main section while ($day_number_counter <= $final_day_number){ ## setup todays info $todays_epoch_date = timelocal(0, 0, 12, ($day_number_counter), $mon, $year); print " <tr>n" if $day_position_counter == 0; if ($todays_day_of_month eq $day_number_counter){ print " <td class='today'>".$day_number_counter."</td>n"; } else { print " <td>".$day_number_counter."</td>n"; } $day_position_counter++; if ($day_position_counter == 7){ $day_position_counter = 0; print " </tr>n"; } $day_number_counter++; } ## now finish off the row if necessary while ($day_position_counter){ print " <td class='blank_date'> </td>n"; $day_position_counter++; if ($day_position_counter == 7){ $day_position_counter = 0; print " </tr>n"; } } print "</table>nn"; print "</body>nn"; print "</html>n"; exit; -- To unsubscribe, e-mail: [Email Removed] For additional commands, e-mail: [Email Removed] <http://learn.perl.org/> <http://learn.perl.org/first-response |
QUOTE |
I have a Perl process which runs on solaris under 5.8.3. It is started with the following command: su - prlusr -c "/usr/bin/perl -w /d/src/plpoll.pl >> /d/audit/`date '+%y%m%d'`.out 2>&1 &" I would like to a daily basis at time switchover and after I have completed my processing, check to see if the audit log file exists(ie, I would pull in the latest time and see if the file say for the 16 Jun: /d/audit/040616.out exists. If it does not, then I want to close output to the current log file and reopen. What I want to replicate is: /d/src/plpoll.pl >> /d/audit/`date '+%y%m%d'`.out 2>&1 Does the above translate to: close(STDOUT); close(STDERR); then open(STDOUT, '>>' . $MyNewLog) open(STDERR, '>>' . $MyNewLog) There would be error checking on both opens. Are those closes and opens what is needed? if not, ay assistance would be appreciated? Note: At this point, I don't have a test box so trying to get a good idea of what is needed before trying to make the changes and insute the processing continues as it should. Thanks. Wags ;) ******************************************************* This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ******************************************************* |
QUOTE |
before chomping the find command did not work as the extracted username has a end of line(or somthing I donno). I gave a email before this and expecting you mail to get me out of trouble.Thank you. chomp($Hme); chomp($user); perldoc -f chomp If you are going to chomp something it should be $line not these two. |
QUOTE |
I knew about that but the problem is most of the users (incuding myself ;p) will want to print it without the same $header info twice and don't want to have a bunch of print scalar whatevr(); If there is no way to tell if fooyou() was called in 'print context' then we'll just use scalar, but I was hoping there was a way to tell... like this would be super nice if such a beast as wantprint existed... return "$header$data1$data2" if wantprint; return ("$header$data1","$header$data2") if wantarray; return "$header$data1$data2"; |
QUOTE |
If the enduser programmer want to force it into scalar context they can: print scalar fooyou(); |