Re: disable back button
On Wed, 20 Aug 2003 14:38:39 +1000, Catriona Wordsworth wrote: pretty simple stuff I hope, but can someone tell me how to disable the back button in my perl script? Cat, once again you chose the wrong list for your question... Even though you create your HTML with perl it is not a possible to use perl to break a browsers back button. BTW. I for once leave web sites of people who try to disable a browsers most used feature. thanks /oliver/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: disable back button
On Tue, 19 Aug 2003 23:36:57 -0800, Dennis Stout wrote: BTW. I for once leave web sites of people who try to disable a browsers most used feature. Same! So far, the only practicle and useful thing I've seen done ot modify a users browser is when making a form of some kind, and you make a popup window come up to enter more information or see a quick snapshot of something. Then the toolbars and things are simply removed, leaving you with an X to click on.. But thats a specialty thing. I still can use my keyboard... which I mostly use to navigate the web. Don't make the life hard on users... they might just leave your site. A good example for not screwing with the user is amazon.com. thanks /oliver/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: disable back button
I still can use my keyboard... which I mostly use to navigate the web. Don't make the life hard on users... they might just leave your site. I made life easier on my users by making the one single popup window I have. It's a ticketing system (written in perl). You click on a ticket number, and the ticket opens in a popup. You type in notes, change hte group queue or private queue ownership or whatever else have you, hit update, and the window goes away automagically as the ticket gets updated. A good example for not screwing with the user is amazon.com. Earhg =/ And yet somehow I continue to bu from them simply because they're cheaper than anywhere else around me. And they offer free shipping. In Alaska, thats a huge deal =) Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: disable back button
BTW. I for once leave web sites of people who try to disable a browsers most used feature. Same! So far, the only practicle and useful thing I've seen done ot modify a users browser is when making a form of some kind, and you make a popup window come up to enter more information or see a quick snapshot of something. Then the toolbars and things are simply removed, leaving you with an X to click on.. But thats a specialty thing. My proxy server gets updated every so often to deny access to broken websites I collect through the week.. Dennis -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Premature end of script headers Linux with Fat32 filesystem
Tim Brom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I dual-boot my computer and I have three partitions, an NTFS partition for Windows XP Pro, an ext3 filesystem for Linux (Red Hat Linux 9.0) and a Fat32 filesystem for my data (because FAT32 is the only filesystem both OS's play nicely with). I keep the data that I want shared stored on this FAT32 partition, including all the files for my websites. Whenever I try to access a script off of the FAT32 partition, I get a 'Premature end of script headers' error message. I can copy the script verbatim onto the ext3 filesystem and it works fine, and it works fine on my web host's server. Does anyone know why I am getting this error message only when the file is coming from a FAT32 filesystem? Thanks. Tim Brom [EMAIL PROTECTED] Sounds like there could be an issue with file formats. Is your web server on Red Hat? Perhaps you need to save your scripts in Unix file format. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: create log as well as print on screen
sub Log{ my $message = shift(); my $LOGNAME = 'log.log'; open(LOGFILE, $LOGNAME) or die(Could not open log file: $!); print LOGFILE $message; close(LOGFILE); } sub Print{ my message = shift(); #Assuming you are passing a string my $Out = *STDOUT; # Standard out. print $Out $message\n; Log($message); #Encapsulate message in quotes to say #Damnit Jim I'm a singl string, not a #space demlimited array! } ==[ D-d-d-D-D_-Disclaimer ] Code provide was pulled outta the air and not tested. Kristofer --- mark sony [EMAIL PROTECTED] wrote: Hi All, I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) Thanx in advance Mark ___ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = -BEGIN GEEK CODE BLOCK- Version: 3.12 GIT d s+:++ a C++ UL++ US+ P+++ L++ W+++ w PS PE t++ b+ G e r+++ z --END GEEK CODE BLOCK-- __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running process in background?
Hi~ 0 * * * * /usr/bin/perl /full/path/to/your/script That will run the script every hour at 0 ByeBye~ Yupapa ### # Yupapa Web Hosting =^.^= # Web Site - http://www.yupapa.com # Email - [EMAIL PROTECTED] ### Kevin Pfeiffer [EMAIL PROTECTED] ???:[EMAIL PROTECTED] In article [EMAIL PROTECTED], Octavian Rasnita wrote: Can you tell me how to define a cron job that is executed each hour? Thank you. 10 0-23 * * * echo run 10 minutes after the hour, every hour, everyday man 5 crontab -- Kevin Pfeiffer International University Bremen -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
create log as well as print on screen
Hi All, I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) Thanx in advance Mark ___ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File::Copy CGI.pm
HiHi~ If you are transfering file from a local machine to a remote machine, you do not use File::Copy module to copy files. File::Copy is used for copying files locally. You can use Net::FTP to transfer files from one machine to another. And of course, you will need a FTP server for the machine receiving the file. Bye~ Yupapa ### # Yupapa Web Hosting =^.^= # Web Site - http://www.yupapa.com # Email - [EMAIL PROTECTED] ### B. Fongo [EMAIL PROTECTED] ???:[EMAIL PROTECTED] Hi, I've a small script intended for file transfer from a windows machine to a remote linux server. To implement that, I decided to use two module i.e File::Basename, File::Copy and CGI.pm. The File::Copy is working well locally, but it fails to copy files to a remote machine through the Browser. I use CGI.pm to generate a form where users could browser and select a file to be transferred. The error message is always: No such file or directory though the file or directory exist and permission is set 777. What may be the case? Any suggestion on how to transfer file to remote location? I'm not sure whether it will be applicable to use file handles and use a loop to read the files from the source location and write them to a destination folder. Thanks for any help ## #!/usr/bin/perl -w use strict; use CGI qw/ :standard/; my $cgi = new CGI; use File::Basename; if( param()){ upload_file(param(upload_file)); } else { print_form(); } Subroutine to transfer file ### sub upload_file{ my ($file, $file_destination, $file_name, $forwarded_value); $original_src = $forwarded_value = $_[0]; $file_destination = q(/data/Software_Pakete); $forwarded_value =~ s/\\/\//g; $file_name = basename($forwarded_value); if (copy($original_src,$file_destination/$file_name)){ print_success() } else{ print_error($forwarded_value,$file_destination/$file _name) } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: create log as well as print on screen
In unix there is a program called tee. It works something like program.pl | tee log.file you just have program.pl write to STDOUT alternatively, in your program, you could just do my $log = log.file; open( LOG, log.file ); print THING\n; print LOG THING\n; close LOG; ( basically print twice for everything you print. -Original Message- From: mark sony [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 8:11 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: create log as well as print on screen Hi All, I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) Thanx in advance Mark ___ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File sizes.
Hi, I have been watching the thread about the file::copy. I ran into an issue in the Linux environment that brings a serious question, MAX file size. Keep in mind the server is running 7.0 RH, we have 7.2 Enterprise Server also, and we pay for support. But even the RH support says they can't handle files in excess of 2GB (approx). I was using TAR, GZIP, or most any functions, I have found that the targeted file is only 1.8GB instead of being a much larger file, in our case 16GB. This was on a /mnt device, not a local disk. So the COPY (TAR in this case) was from one /mnt/ device to another, it did not matter if I used TAR, COPY, MOVE, or a Perl program, same problem. Everyone I talked to about this on the various Groups only said Rebuild the kernel using 64 bit support, but this is on an Intel box (32 bit?). Have any of YOU seen this problem? I can't be the only person dealing with large files. Ideas?? How is this issue on later releases?? THanks. -- Rich Parker -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: the File::Copy module
Hello, Thanks for all your inputs now below you mentioned copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) sorry for my ignorance but what is qq also if I want to be smart and copy it to the c: drive of some user - assuming I am running the script from a Domain Admin login eg. \\machine1\c$\file then the dollar sign won't work as expected right - given my limited understanding will a \$ work then!!! Regards --- Dan Muey [EMAIL PROTECTED] wrote: --- Dan Muey [EMAIL PROTECTED] wrote: Try: use strict; use warnings; ... my $returnValue = copy(machine1\\share\\file1,machine2\\share\\file2); ^ I think that quote will cause problems. Have you tried single quotes also? That way you don't have to worry about properly escaping the \. copy('\\machine1\share\file1','\\machine2\share\file2') or die Copy failed $!; Just a thought That won't work if the write decides that file1 should be a variable instead. Just a thought :-/ Ok, in the example file1 wasn't a variable but if you dod want to do \\machine1\share\$file copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) or ... Would that cover all the bases? DMuey Dmuey -JW __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: the File::Copy module
I only know the first part. qq is double quotes. As opposed to the qw which is single quotes. Good for interpolating! -T - Original Message - From: Saadat Saeed [EMAIL PROTECTED] To: Dan Muey [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 11:07 PM Subject: RE: the File::Copy module Hello, Thanks for all your inputs now below you mentioned copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) sorry for my ignorance but what is qq also if I want to be smart and copy it to the c: drive of some user - assuming I am running the script from a Domain Admin login eg. \\machine1\c$\file then the dollar sign won't work as expected right - given my limited understanding will a \$ work then!!! Regards --- Dan Muey [EMAIL PROTECTED] wrote: --- Dan Muey [EMAIL PROTECTED] wrote: Try: use strict; use warnings; ... my $returnValue = copy(machine1\\share\\file1,machine2\\share\\file2); ^ I think that quote will cause problems. Have you tried single quotes also? That way you don't have to worry about properly escaping the \. copy('\\machine1\share\file1','\\machine2\share\file2') or die Copy failed $!; Just a thought That won't work if the write decides that file1 should be a variable instead. Just a thought :-/ Ok, in the example file1 wasn't a variable but if you dod want to do \\machine1\share\$file copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) or ... Would that cover all the bases? DMuey Dmuey -JW __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
access mdb file from perl.....,.
Hello all, I have a mdb file(ms access) on linux server. Is there any method to access this mdb file from perl? Thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mdb file
Hello all, I have a mdb file(ms access) on linux server. Is there any method to access this mdb file from perl? Thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: access mdb file from perl.....,.
Quoting cowboy [EMAIL PROTECTED]: Hello all, I have a mdb file(ms access) on linux server. Is there any method to access this mdb file from perl? Here's a good summation post and follow-up on London Perl Mongers list: http://kochi.etla.org/london.pm/html/2002/07/msg00068.html Basically, it recommends two tools -- MDBTools on Linux and http://mdbtools.sourceforge.net/ ActivePerl's DBD::ODBC on Windows (I assume). I had the (misfortunate) task of dealing with an MDB on Linux just over a year ago and found MDBTools to be very sufficient for extracting data from the MDB (it didn't write to the file at the time). Take a look at that SourceForge tool. If you want to read/write to the file, you might be better off making a secure connection between an MS Access DB on a windows machine to connect with your Linux-based database server. I use this technique on occasion by creating an SSH tunnel via PuTTY on Windows to make available the Linux server MySQL database to the Access program on my desktop. Then I connect to MySQL via ODBC to load local data (for customer data dumps, etc) and disconnect after completion. HTH, Robert J Taylor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I need help using %Hashes
Horace Franklin Jr. [EMAIL PROTECTED] ¼¶¼g©ó¶l¥ó·s»D :[EMAIL PROTECTED] Help! I need help using %hashes to receive input from the form below. What changes would I make to the syntax of the commented lines below to do this?. my $form = E_FORM; h3Hello!/h3 form action=$url method=post # pbMy name is/b: input type=text name=name//p # pbMy E-mail is/b: input type=text name=email//p pbMessage/b:/p # ptextarea cols=30 rows=6 wrap=virtual name=message/p pType your message here. /textarea input type=submit/p /form E_FORM $form; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: the File::Copy module
On Wednesday, August 20, 2003, at 01:45 AM, Trina Espinoza wrote: I only know the first part. qq is double quotes. As opposed to the qw which is single quotes. Close. qq() is double quotes, you got that right. q() is single quotes. qw() is the Quote Words operator. It turns this: qw(some words and spaces) ...into this: (some, words, and, spaces) Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
writing back to a file
Hi, Newbie here. I am writing a program that takes a file that has two columns of words, extracts the second column, then saves the original file with only the data in the first column. Question #1 - would it be better to do this w/ the split or s/// functions ? Question #1 - how do I write back the results to the original file ? I tried using + or but all these do is add to the original file and not re-write it. if I open it like this then it erases the file first and I get no data. my source file (searchandreplace.txt) looks like this: X Y X Y X Y my code looks like this: my $source_file = searchandreplace.txt; open(SOURCE, +$source_file) || die can't open file: $1; flock(SOURCE,2); foreach ( SOURCE ) { s/\s+\w+//; print SOURCE ; } after I run the program it looks like this: X Y X Y X Y X X X instead of what I want X X X thanx for your patience. AN -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple regex in if() staetment
On Tuesday, August 19, 2003, at 05:54 PM, Dan Muey wrote: I'm trying to figure out the best way to test a string agains a list of regexs like so: my @regex = qw(qr(joe$) qr(^mama) qr([abc])); I see you already got your grep() answer, but... There's definitely no reason to use that qw() operator and plenty not to: my @regex = (qr(joe$), qr(^mama), qr([abc])); James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: writing back to a file
On Wednesday, August 20, 2003, at 08:12 AM, Absolut Newbie wrote: Hi, Howdy. Newbie here. I am writing a program that takes a file that has two columns of words, extracts the second column, then saves the original file with only the data in the first column. Question #1 - would it be better to do this w/ the split or s/// functions ? I don't think it matters too much, if you're sure of the format. Use what's easiest for you. Question #1 - how do I write back the results to the original file ? I tried using + or but all these do is add to the original file and not re-write it. + is read and write, is write and will clobber the file first. if I open it like this then it erases the file first and I get no data. This is append mode and should not have clobbered the file. I suspect you got a couple of these confused. my source file (searchandreplace.txt) looks like this: X Y X Y X Y my code looks like this: my $source_file = searchandreplace.txt; open(SOURCE, +$source_file) || die can't open file: $1; flock(SOURCE,2); foreach ( SOURCE ) { Don't do that. When you want to read line by line, use: while (SOURCE) { #... } Your loop reads the entire file into memory, mine handles it line by line, but they work the same on the inside. s/\s+\w+//; print SOURCE ; } after I run the program it looks like this: X Y X Y X Y X X X instead of what I want X X X thanx for your patience. Super easy method first, from the command line: perl -pli.old -e 's/\s\w+$//' searchandreplace.txt If you prefer to do it in a script though, here's how I would go about it. Open your source file for reading and another file for writing. Copy it over and when you're done, you can rename it to the original name to replace the old file. Good luck. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Executable perl program help!!
How can i generate such a file? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Array to hash with reverse split?
[SNIP] John #/usr/local/bin -w John ^^ JohnI see no 'perl' there. Typo. [SNIP] John my (@ARRAY, %TEST, $FILTER) = ; John John Why are you assigning to the first element of @ARRAY? 'Cause I'm an idiot... [SNIP] John Perl has the tools to do most of that without running an external John program like 'ls' or 'grep'. Yes, thank you, I know. I will be dealing with data that is arranged SIMILAR TO THE OUPUT OF ls -l, NOT THE ACTUAL OUTPUT OF THAT COMMAND and it will have NOTHING to do with files or directories, in fact it will be diagnostic output of instruments. All I wanted to know how to get an element of an array out, reverse it, break it up and put it in a hash. I have figured out a better way without arrays. Thanks for the mapping portion of your script, that was most useful. Thanks everyone. [SNIP] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Executable perl program help!!
[EMAIL PROTECTED] wrote: How can i generate such a file? Million dollar question , No perfect answer. Depends on what OS you are using. Do a google on perl2exe For starters try the O.pm. To convert your perlcode to C and then compile the C code On linux You can compile using export LDOPTS=`perl -MExtUtils::Embed -e ldopts` export CCOPTS=`perl -MExtUtils::Embed -e ccopts` perl -MO=C script.pl script.c gcc $CCOPTS script.c -o script $LDOPTS This works only on some scripts. The O.pm is still evolving Ram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Executable perl program help!!
Rich Parker wrote: I was at Active State the other day, they have one that can be purchased. I have seen a few others when I did a similar search as mentioned. I haven't seen one for free or one that has a demo for it, I'd love to try one, if anyone sees one, let everyone know about it. You can download a demo version of ActiveState's Perl Dev Kit: http://www.activestate.com/Products/Download/Register.plex?id=PerlDevKita= e -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File sizes.
On Tue, 19 Aug 2003 14:20:47 -0700, Rich Parker [EMAIL PROTECTED] wrote: Hi, I have been watching the thread about the file::copy. I ran into an issue in the Linux environment that brings a serious question, MAX file size. Keep in mind the server is running 7.0 RH, we have 7.2 Enterprise Server also, and we pay for support. But even the RH support says they can't handle files in excess of 2GB (approx). I was using TAR, GZIP, or most any functions, I have found that the targeted file is only 1.8GB instead of being a much larger file, in our case 16GB. This was on a /mnt device, not a local disk. So the COPY (TAR in this case) was from one /mnt/ device to another, it did not matter if I used TAR, COPY, MOVE, or a Perl program, same problem. Everyone I talked to about this on the various Groups only said Rebuild the kernel using 64 bit support, but this is on an Intel box (32 bit?). Have any of YOU seen this problem? I can't be the only person dealing with large files. Ideas?? How is this issue on later releases?? I am no kernel hacker so take what I say with a grain of salt. The large file size has to do with the addressable space on the disk which to support over 2 gigs you need more bits to produce longer addresses, which is I believe why they suggested you add 64 bit support. Its been a while since I was doing kernel builds but I thought there was a specific switch for large file size, but I thought this was specifically to support partitions of larger than 2 GB not files themselves, but maybe they are one in the same. Now you mention that the file is 1.8 GB, is that machine readable or human readable, aka is that where 1 KB = 1000 bytes or 1024 bytes? It is likely that your file exceeds the 2 GB boundary if the 1.8 is human readable. I am not sure about copy, theoretically it should work if the file can be addressed completely, move won't work accross file system boundaries anyways, nor will a 'rename' in Perl. Again because Perl is talking to the underlying kernel theoretically you would need large file support in the kernel first, but then you *ALSO* need it in the 'perl' (not Perl) executable. For instance, perl -V will have something near the bottom like: Compile-time options: ... USE_LARGE_FILES ... Though I am also not a Perl internals hacker so I don't know what all this adds, but I suspect it is needed in your case if you do use a Perl script. To my knowledge this has been fixed in 2.4 or newer kernels (are you running 2.2?), or it was fixed by default from the jump from RH 7.x to RH 8.0. Maybe one of the real gurus can provide better explanation/help... In any case you may get better help asking on a Linux kernel list... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple regex in if() staetment
Thanks for the pointers! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Executable perl program help!!
Also try http://www.indigostar.com/ Laurent coudeur Bob Showalter [EMAIL PROTECTED] 20/08/2003 16:20 To: 'Rich Parker' [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:RE: Executable perl program help!! Rich Parker wrote: I was at Active State the other day, they have one that can be purchased. I have seen a few others when I did a similar search as mentioned. I haven't seen one for free or one that has a demo for it, I'd love to try one, if anyone sees one, let everyone know about it. You can download a demo version of ActiveState's Perl Dev Kit: http://www.activestate.com/Products/Download/Register.plex?id=PerlDevKita= e -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Executable perl program help!!
How can i generate such a file? # vi mysript.pl : #!/usr/bin/perl -w use strict; print hello\n; # ./myscript.pl Bash: Bad command or file name : Permission denied # chmod 755 myscript.pl # ./myscript.pl hello # On unix it has to be executable by the user running it, commonly 755 or on winders you have to have the file extension .pl associated with the perl binary which is usually done on installing Perl. HTH DMuey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: the File::Copy module
--- Saadat Saeed [EMAIL PROTECTED] wrote: Hello, Thanks for all your inputs now below you mentioned copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) sorry for my ignorance but what is qq In perl, there are many things to do things right. That is the beauty of perl, whether you use double backslashes or 'qq' or whatever. That is the wonderful thing about this list -- you learn new ideas how things are done in the real world! As for qhat 'qq' does, it behaves like double quotes. As you pointed out, it CAN make your code harder to read (!) sincemany people are not accustomed to it. For me, '' is more customary (with C/C++ or shell), so therefore, more readable. TO each their own :) also if I want to be smart and copy it to the c: drive of some user - assuming I am running the script from a Domain Admin login eg. \\machine1\c$\file then the dollar sign won't work as expected right - given my limited understanding will a \$ work then!!! Again, you need to escape the backslashes, either with qq{...} or ''. You want to have the '$' interpolated, meaning, it should not be escaped. You should be fine with what you have -- although you don't need to qualify as such in IMHO. -JW __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Executable perl program help!!
[EMAIL PROTECTED] wrote: Also try http://www.indigostar.com/ Laurent coudeur Quick question about this, sounds great. But if I were running my Perl from an http call (Normal browser usage), what would the exec cgi call Look like, syntax wise?? Thanks. Bob Showalter [EMAIL PROTECTED] 20/08/2003 16:20 To: 'Rich Parker' [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:RE: Executable perl program help!! Rich Parker wrote: I was at Active State the other day, they have one that can be purchased. I have seen a few others when I did a similar search as mentioned. I haven't seen one for free or one that has a demo for it, I'd love to try one, if anyone sees one, let everyone know about it. You can download a demo version of ActiveState's Perl Dev Kit: http://www.activestate.com/Products/Download/Register.plex?id=PerlDevKita= e -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sco Print
Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Array to hash with reverse split?
Linux Rocks wrote: John Perl has the tools to do most of that without running an external John program like 'ls' or 'grep'. Yes, thank you, I know. I will be dealing with data that is arranged SIMILAR TO THE OUPUT OF ls -l, NOT THE ACTUAL OUTPUT OF THAT COMMAND and it will have NOTHING to do with files or directories, in fact it will be diagnostic output of instruments. Sorry, your original post said I want to read contents of a dir, filtered, into a hash. If you had presented your actual problem I might have been able to provide better help. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sco Print
Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 Howdy, Get file contents from db into a variable I'd say open a pipe to lp -dP5 (Use the actual path to avoid headaches) The write the contetn of the file to the FILEHANDLE The close the FILEHANDLE Rinse , lather, repeat perldoc -f open HTH Dmuey But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: writing back to a file
Absolut Newbie wrote: Hi, Hello, Newbie here. I am writing a program that takes a file that has two columns of words, extracts the second column, then saves the original file with only the data in the first column. Question #1 - would it be better to do this w/ the split or s/// functions ? Question #1 - how do I write back the results to the original file ? I tried using + or but all these do is add to the original file and not re-write it. if I open it like this then it erases the file first and I get no data. my source file (searchandreplace.txt) looks like this: X Y X Y X Y my code looks like this: my $source_file = searchandreplace.txt; open(SOURCE, +$source_file) || die can't open file: $1; flock(SOURCE,2); foreach ( SOURCE ) { s/\s+\w+//; print SOURCE ; } after I run the program it looks like this: X Y X Y X Y X X X instead of what I want X X X The simplest way I could think of doing that would be: use warnings; use strict; use Tie::File; use Fcntl ':flock'; my $source_file = 'searchandreplace.txt'; my $t = tie my @data, 'Tie::File', $source_file or die Cannot open $source_file: $!; $t-flock( LOCK_EX ); s/\s+\w+// for @data; untie @data; __END__ John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sco Print
The script is not going to be run from the sco server. :) That's my problem if I could run the script there this wouldn't be an issue. Ohh - Well then give Net::Telnet $tnet-cmd(echo $fileguts | /bin/lp -dP5); or somehtign like that Net::Ssh::Perl Net::FTP a look HTH Dmuey -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 1:38 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Sco Print Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 Howdy, Get file contents from db into a variable I'd say open a pipe to lp -dP5 (Use the actual path to avoid headaches) The write the contetn of the file to the FILEHANDLE The close the FILEHANDLE Rinse , lather, repeat perldoc -f open HTH Dmuey But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: create log as well as print on screen
From: mark sony [EMAIL PROTECTED] I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) http://search.cpan.org/dist/IO-Tee/ http://jenda.krynicky.cz/#Local::TeeOutput HTH, Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sco Print
PERFECT!!! Thanks! -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 2:10 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Sco Print The script is not going to be run from the sco server. :) That's my problem if I could run the script there this wouldn't be an issue. Ohh - Well then give Net::Telnet $tnet-cmd(echo $fileguts | /bin/lp -dP5); or somehtign like that Net::Ssh::Perl Net::FTP a look HTH Dmuey -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 1:38 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Sco Print Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 Howdy, Get file contents from db into a variable I'd say open a pipe to lp -dP5 (Use the actual path to avoid headaches) The write the contetn of the file to the FILEHANDLE The close the FILEHANDLE Rinse , lather, repeat perldoc -f open HTH Dmuey But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sco Print
The script is not going to be run from the sco server. :) That's my problem if I could run the script there this wouldn't be an issue. -Original Message- From: Dan Muey [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 1:38 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Sco Print Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 Howdy, Get file contents from db into a variable I'd say open a pipe to lp -dP5 (Use the actual path to avoid headaches) The write the contetn of the file to the FILEHANDLE The close the FILEHANDLE Rinse , lather, repeat perldoc -f open HTH Dmuey But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Spreadsheet::WriteExcel formulas
Hello, I use the module Spreadsheet::WriteExcel and have following effect by generating formulas ... # Formulas my $formel = $worksheet - store_formula('=IF(A2=A1,X,-);'); for my $row (1..$anz_rows) { $worksheet - repeat_formula($row, 8, $formel, $f_standard, 'A2', 'A'.($row + 1), 'A1', 'A'.$row ); } ... The generate Excel (german) look like this: =WENN(A9=A8;X;-) =WENN(A90=A1;X;-)- I would like A10 =WENN(A101=A1;X;-) - I would like A11 ... =WENN(A20=A19;X;-) also from A10 until A19 is not correct. Who can help me ? Thank you. Olivier -- COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test -- 1. GMX TopMail - Platz 1 und Testsieger! 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger! 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File sizes.
Rich Parker wrote: Hi, I have been watching the thread about the file::copy. I ran into an issue in the Linux environment that brings a serious question, MAX file size. Keep in mind the server is running 7.0 RH, we have 7.2 Enterprise Server also, and we pay for support. But even the RH support says they can't handle files in excess of 2GB (approx). i believe RH 7.1 beta r1 (code name Fisher) which uses kernel 2.4.0 is the first RH that supports the LFS (Large File Support) extension. your server running 7.0 won't be able to address 2GB file. If you have 7.2 Enterprise, why don't you use that instead? If you pay for support, isn't RH suppose to provide help / instruction on how to get your 7.0 with LFS support? if you simply want to know if Perl is able to deal with 2GB file, you can: [panda]$ perl -V | grep 'uselargefiles' and you should see something like: uselargefiles=define to see that if perl (the binary) is compiled to use LFS API, use: [panda]$ perl -V | grep 'OFFSET_BIT' and if you see something like: D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 you are in good shape. the easiest solution to get LFS support is to upgrade your 7.0 imo. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: writing back to a file
AN wrote: Hi, Newbie here. I am writing a program that takes a file that has two columns of words, extracts the second column, then saves the original file with only the data in the first column. Question #1 - would it be better to do this w/ the split or s/// functions ? Question #1 - how do I write back the results to the original file ? I tried using + or but all these do is add to the original file and not re-write it. if I open it like this then it erases the file first and I get no data. my source file (searchandreplace.txt) looks like this: X Y X Y X Y my code looks like this: my $source_file = searchandreplace.txt; open(SOURCE, +$source_file) || die can't open file: $1; flock(SOURCE,2); foreach ( SOURCE ) { s/\s+\w+//; print SOURCE ; } after I run the program it looks like this: X Y X Y X Y X X X instead of what I want X X X thanx for your patience. AN try this: my $source_file = searchandreplace.txt; open(IN,$source_file) || die can't open file: $1; while(IN) { $row = $_; $row =~ s/\s+\w+//i; push(@arr, $row); } close(IN); open(OUT,$source_file ) || die can't open file: $1; foreach (@arr) { print OUT $_; } close(OUT); E. LOQUENDO S.p.A. Vocal Technology and Services www.loquendo.it [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CONFIDENTIALITY NOTICE This message and its attachments are addressed solely to the persons above and may contain confidential information. If you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it immediately to the sender and delete the message. Should you have any questions, please contact us by replying to [EMAIL PROTECTED] Thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: writing back to a file
try this: my $source_file = searchandreplace.txt; open(IN,$source_file) || die can't open file: $1; while(IN) { $row = $_; $row =~ s/\s+\w+//i; push(@arr, $row); } close(IN); open(OUT,$source_file ) || die can't open file: $1; foreach (@arr) { print OUT $_; } close(OUT); If you want to do it in one clean open/ close sequence (using + as the open command, like you had originally) simply do it like Darbesio suggested above but where he closes and opens the file again truncate the file to zero-length (look up truncate on perldoc) and then seek to the beginning of the file (look up seek too) then do your writes. should look something like this: truncate FILE, 0; seek FILE, 0, 0; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using hex.
Howdy, I use many different languages here at work, from Assembly, Rexx, to other mainframe languages. One thing I find it difficult to do with Perl is the handling of Hex characters. This may seem like a very generalized question, forgive me for trying to find a Better way to do it. Picture having a flat file, or an SQL table (Doesn't matter that much), I want to delimit a field within a field, like having options. I can't use the TAB (\t) character, because when I use the foreach the sub fields also get Split, therefore loosing what I am attempting to do. So I wanted to use a hex character, let's say something simple, hex'01' for example. What do you guys use for saying something like: $loc = index($rec, $HexValue); OR @sub_field1 = split(/$HexValue/, $rec); Where the $HexValue is either a variable that contains my hex'01' or the absolute value itself. I've used 'sprintf' to limited success, but in other languages this is very simple. I'm looking for some different ways to do this, after all, that's what Perl is all about right? TIMTOWTDI... What's some of your things you guys use?? Thanks, ahead of time. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File sizes.
Hi, I have been watching the thread about the file::copy. I ran into an issue in the Linux environment that brings a serious question, MAX file size. Keep in mind the server is running 7.0 RH, we have 7.2 Enterprise Server also, and we pay for support. But even the RH support says they can't handle files in excess of 2GB (approx). i believe RH 7.1 beta r1 (code name Fisher) which uses kernel 2.4.0 is the first RH that supports the LFS (Large File Support) extension. your server running 7.0 won't be able to address 2GB file. If you have 7.2 Enterprise, why don't you use that instead? If you pay for support, isn't RH suppose to provide help / instruction on how to get your 7.0 with LFS support? if you simply want to know if Perl is able to deal with 2GB file, you can: [panda]$ perl -V | grep 'uselargefiles' and you should see something like: uselargefiles=define to see that if perl (the binary) is compiled to use LFS API, use: [panda]$ perl -V | grep 'OFFSET_BIT' and if you see something like: D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 you are in good shape. the easiest solution to get LFS support is to upgrade your 7.0 imo. david David, Thanks for the observations. But the point that RH made to me (Again, about 6 months ago) was that this issue was in 7.0-7.2 and YES, they did not recommend rebuilding the kernel because at THAT time the 2.4 was Buggy in their opinion. I am not so worried about Perl being able to READ/WRITE or what ever for large files, but the O/S has to be able to do this first, correct? That's my main point and the obstacles I've run into on this. It seems like to me, it is time to revisit this with the RH folks to see what THEY say about it, then go through the pain of upgrading a server with a ton of perl code on it, of course, everything must be TESTED to make 100% sure I haven't dropped anything through the cracks. Thankx... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using hex.
Rich Parker wrote: Howdy, Hello, I use many different languages here at work, from Assembly, Rexx, to other mainframe languages. One thing I find it difficult to do with Perl is the handling of Hex characters. This may seem like a very generalized question, forgive me for trying to find a Better way to do it. Picture having a flat file, or an SQL table (Doesn't matter that much), I want to delimit a field within a field, like having options. I can't use the TAB (\t) character, because when I use the foreach the sub fields also get Split, therefore loosing what I am attempting to do. So I wanted to use a hex character, let's say something simple, hex'01' for example. What do you guys use for saying something like: $loc = index($rec, $HexValue); OR @sub_field1 = split(/$HexValue/, $rec); Where the $HexValue is either a variable that contains my hex'01' or the absolute value itself. I've used 'sprintf' to limited success, but in other languages this is very simple. I'm looking for some different ways to do this, after all, that's what Perl is all about right? TIMTOWTDI... Yes, that's right, there is more than one way to do it: my $HexValue = \01; # or \x1 my $HexValue = chr 1; my $HexValue = pack 'C', 1; my $HexValue = sprintf '%c', 1; vec( my $HexValue, 0, 8 ) = 1; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: the File::Copy module
--On Wednesday, August 20, 2003 8:01 AM -0700 Jeff Westman [EMAIL PROTECTED] wrote: As for qhat 'qq' does, it behaves like double quotes. As you pointed out, it CAN make your code harder to read (!) sincemany people are not accustomed to it. For me, '' is more customary (with C/C++ or shell), so therefore, more readable. TO each their own :) qq() can also make code easier to read. Compare print qq{p class=myclassI like lithts, Tom lisped./p}; to print p class=\myclass\\I like lithts,\ Tom lisped./p; (GDR) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple Inheritance.
I'm having trouble doing multiple inheritance...I want to inherit not only the subroutines from two classes, but also the instance variables. how do i do this? Thanks in advance -- Erich Musick http://erichmusick.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Inheritance.
On Wednesday, August 20, 2003, at 04:30 PM, Erich Musick wrote: I'm having trouble doing multiple inheritance...I want to inherit not only the subroutines from two classes, but also the instance variables. how do i do this? Methods are the easy part: our @ISA = qw(ClassOne ClassTwo Etc); Perl doesn't really provide a method for instance variable inheritance (even for single inheritance), but you can generally roll your own easy enough. Here's one possible method: sub new { my $class = shift; my $object = { }; $object = $_-new(%$object) foreach @ISA; # class specific initialization here... return bless $object, ref($class) || $class; } This is heavily dependent on the classes you are trying to inherit from though, so you may have to get a little more creative. Watch for parent classes stomping on each others' member data with this too, it could happen. If you need something more robust, you might create instances of the parent classes as store them internally as private instance data. You could then basically use your class as a proxy for them, passing what is needed, to who, when. You probably need to do a little more subroutine work for this method, though I imagine most of them would just be one-liners calling the appropriate parent method on the internal object. A good AUTOLOAD with a little can() magic should even get you around this, if you're Lazy. Well, hopefully that at least gives you a couple of ideas. Good luck. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl XS
Help! I have written a perl module that uses XS to reach out to a password database and retrieve a password for eventual use in DBI. My problem is Linux related. I have compiled and tested this code on HP and Sun and it works just fine there. However on my RedHat AS2.1 box, the code refuses to function correctly. My first errors were related to getting perl to find Sybase libs. One of my colleagues suggested that I use LD_PRELOAD to identify the libraries that are required. This resolved the issues with the undefined symbol ct_cmd_alloc. Now my perl test code appears to load the module correctly, however, when it goes to execute the succeeding tests, they are being skipped as the first test which use's the module returns t/1 ok 1/3 t/1.dubious Test returned status 0 (wstat 139, 0x8b) DIED. FAILED tests 2-3 I think its still having issues with correctly loading the module, but I am unsure of where to go from here. WTF does wstat = 139 mean ? Any suggestions would be appreciated. BTW, the module cores after the tests are finished. Chuck Fox Principal Database Administrator America Online, INC. Additional Info: Linux AS 2.1 2.4.9-e.12smp #1 SMP Sybase 12.5 Perl 5.8.0 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reading columns from a file
Hi, I have a similar problem that someone just asked about reading specific columns from a file and writing to another file. Eventually, I want to read the written file to be loaded into Matlab. Im having trouble writing the regular expression for this file. The format of the file looks like this: Cell1=481 13 N control AFFX-MurIL2_at 0 13 A A A 0 8801 -1 -1 99 Cell2=481 12 N control AFFX-MurIL2_at 0 13 A T A 0 8161 -1 -1 99 I want to read the column mentioning 481 and leaving Cell?= portion. Then second col. ie 13/12, third col, 5th(AFFX-KurIL2_at) and 7th(13/13). Please suggest how do i do that. The code i tried is as follows: $writefilename = 'final.txt'; open(READFILE1,$writefilename); open(WRITEFILE1,cdf.txt); @array=READFILE1; $len=scalar(@array); print $len; #foreach $lineblock(@array){ # @colarray=split(/\w+\=\d+\s+\d+\s+\w\s+\w+\s+\w+\-\w+\-\w+\s+\d\s+\d+\s+\w\s+\w\s+\w\s+\d\s+\d+\s+\d\s+\d\s+\d+/, $lineblock); # print WRITEFILE1 @colarray[1]; #} foreach$lineblock(@array){ @colarray=split(/\s*/,$lineblock); $colarray[0]=~ s/Cell\d=//ig; foreach $col(@colarray){ print WRITEFILE1 $col; } } close READFILE1; close WRITEFILE1; exit; Thanks, Shahzad. - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software
or or ||
I often have a line like this at the beginning of my scripts: @ARGV or die Usage: blah\n; ... but I've seen: @ARGV || die Usage: blah\n; Could someone explain the difference? - Bryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File sizes.
On Tue, 19 Aug 2003 14:20:47 -0700, Rich Parker [EMAIL PROTECTED] wrote: Hi, I have been watching the thread about the file::copy. I ran into an issue in the Linux environment that brings a serious question, MAX file size. Keep in mind the server is running 7.0 RH, we have 7.2 Enterprise Server also, and we pay for support. But even the RH support says they can't handle files in excess of 2GB (approx). I was using TAR, GZIP, or most any functions, I have found that the targeted file is only 1.8GB instead of being a much larger file, in our case 16GB. This was on a /mnt device, not a local disk. So the COPY (TAR in this case) was from one /mnt/ device to another, it did not matter if I used TAR, COPY, MOVE, or a Perl program, same problem. Everyone I talked to about this on the various Groups only said Rebuild the kernel using 64 bit support, but this is on an Intel box (32 bit?). Have any of YOU seen this problem? I can't be the only person dealing with large files. Ideas?? How is this issue on later releases?? I am no kernel hacker so take what I say with a grain of salt. The large file size has to do with the addressable space on the disk which to support over 2 gigs you need more bits to produce longer addresses, which is I believe why they suggested you add 64 bit support. Its been a while since I was doing kernel builds but I thought there was a specific switch for large file size, but I thought this was specifically to support partitions of larger than 2 GB not files themselves, but maybe they are one in the same. Now you mention that the file is 1.8 GB, is that machine readable or human readable, aka is that where 1 KB = 1000 bytes or 1024 bytes? It is likely that your file exceeds the 2 GB boundary if the 1.8 is human readable. I am not sure about copy, theoretically it should work if the file can be addressed completely, move won't work accross file system boundaries anyways, nor will a 'rename' in Perl. Again because Perl is talking to the underlying kernel theoretically you would need large file support in the kernel first, but then you *ALSO* need it in the 'perl' (not Perl) executable. For instance, perl -V will have something near the bottom like: Compile-time options: ... USE_LARGE_FILES ... Though I am also not a Perl internals hacker so I don't know what all this adds, but I suspect it is needed in your case if you do use a Perl script. To my knowledge this has been fixed in 2.4 or newer kernels (are you running 2.2?), or it was fixed by default from the jump from RH 7.x to RH 8.0. Maybe one of the real gurus can provide better explanation/help... In any case you may get better help asking on a Linux kernel list... http://danconia.org You have a very good point, I've seen that LARGE_FILES thing in the set up, however, the people at RedHat said not to do that, but rather wait for the next release of the 2.4 kernel, at that time (About 6 months ago) 2.4 was real Buggy according to them. Yet the current Advertised release of RH is 9.0!! Which makes me wonder about it, the stuff you can pay Support for is way back on the release scale. Here at work we also have a S/390 running VM and I've been trying to get the Powers at be to allow me to use the Linux and all of the things that go with that, gee, like PERL, but it has been a real up hill battle. If any of you can give me a GREAT reason to help me convince them, then I'm All ears. I can see the Bennies of having a whole bunch of servers on ONE box, but it's very difficult to get them to the next step, $30K for TCP/IP for VM, which we would need. But then that 2GB limit hits me square in the face again. To answer your question about the 1.8, YES, when I use ANY piece of software, or do an LS, for example, it only shows 1.8GB when on the WinNT machine where the files sits, it shows 16GB, for example. Didn't matter which piece of software or what command I was using. I don't think I would see this if I was using Perl in a Win32 arena, but with all of the troubles I had pushing huge amounts of SQL data through the cgi interface, I had to abandon the Win32 for the more stable and less Buggy Linux, but then I ran into the 2GB limit. Looks like WE have to wait until the Enterprise edition gets the newer kernel, agreed? But I HATE waiting... Cal me impatient... Thanks... -- Rich Parker -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parse text file and increment
Hello, I have a perl script that opens up a text file and displays the data fine. My textfile: 111.111.111.1-25|DEPTA 222.222.222.50-60|DEPTB What I would like to do is have it increment 1 through 25, and 50 through 60, and display that like so: SO FAR .. here is the data file hosts.dat: 111.111.111.444|DEPTA # DEPTB Stuff 222.222.222.1-15|DEPTB 222.222.222.20|DEPTB # DEPTC INFO 333.333.333.20-25|DEPTC # 444.444.44.555|DEPTF here is script create.pl: #!/usr/bin/perl -w while () { next if /^#/; # skip comments. if (/\b-\b/){ print; } } bash-2.03# ./create.pl host.dat 222.222.222.1-15|DEPTB 333.333.333.20-25|DEPTC bash-2.03# WHAT I NEED... So what im looking at doing is having IP's with - print out as so and to a new file: 222.222.222.1|DEPTB 222.222.222.2|DEPTB . . 222.222.222.15|DEPTB 333.333.333.20|DEPTC 333.333.333.21|DEPTC . . 333.333.333.25|DEPTC Thanks up Front… Ron -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: or or ||
Bryan Harris wrote: I often have a line like this at the beginning of my scripts: @ARGV or die Usage: blah\n; ... but I've seen: @ARGV || die Usage: blah\n; Could someone explain the difference? The only difference (other than readability) between or and || operators (as well as and and ) is the precedence. See perlop manpage: http://www.perldoc.com/perl5.8.0/pod/perlop.html There's no difference between: @ARGV or die; and @ARGV || die; but there is a difference e.g. with assignment, which has lower precedence than || but higher than or: $x = shift or die; # means ($x = shift) or die; $x = shift || die; # means $x = (shift || die); $x = shift || default; # OK- means $x = (shift || default); $x = shift or default; # wrong - means ($x = shift) or default; In the last example $x is never set to default. -zsdc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using hex.
Rich Parker wrote: $loc = index($rec, $HexValue); OR @sub_field1 = split(/$HexValue/, $rec); Where the $HexValue is either a variable that contains my hex'01' or the absolute value itself. The chr function returns the character with a given ASCII (or Unicode) value and you can use \x01 inside of double-quoted strings, so e.g. to have a space, you could write: $char = chr 32;# decimal $char = chr 0x20; # hexadecimal $char = \x20;# hexadecimal $char = \040;# octal $HexValue = v32; # decimal or $string = abc\x{20}def 123\x{20}456; etc. Is that what you need? Take a look at perldata manpage: http://www.perldoc.com/perl5.6/pod/perldata.html#Scalar-value-constructors and Quote and Quote-like Operators in perlop manpage: http://www.perldoc.com/perl5.6/pod/perlop.html#Quote-and-Quote-like-Operators -zsdc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parse text file and increment
rmck wrote: I have a perl script that opens up a text file and displays the data fine. My textfile: 111.111.111.1-25|DEPTA 222.222.222.50-60|DEPTB What I would like to do is have it increment 1 through 25, and 50 through 60, and display that like so: Try something like this: #!/usr/bin/perl -nlw if (/(.*)\b(\d+)-(\d+)\b(.*)/) { print $1$_$4 for $2..$3; } else { print; } If the line is something, number-number, something it iterates from the first number to the second one ($2..$3) printing the line for every number in the sequence (which is in $_). Otherwise it just prints the original line. -zsdc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Sco Print
Paul Kraus wrote: Is there a way using perl that I can send a text file to a sco openserver print cue. On the server I would print the file using cat filename.txt | lp -dP5 But the files are not on the server and I would like to automate the process. There is a batch of reports that I have to print each month. I want to store storing the files in a database and then printing them automatically on the correct dates. I can handle all of this except how to go about getting them on the sco box and sent to the spooler. Why not configure a remote printer on the box that generates the reports to send to the lpd on the SCO box? Then you can just print with lp. I'm assuming the printer is hardwired to the SCO box and doesn't have its own lpd server. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reading columns from a file
Shahzad A Khalid wrote: Hi, Hello, I have a similar problem that someone just asked about reading specific columns from a file and writing to another file. Eventually, I want to read the written file to be loaded into Matlab. Im having trouble writing the regular expression for this file. The format of the file looks like this: Cell1=481 13 N control AFFX-MurIL2_at 0 13 A A A 0 8801 -1 -1 99 Cell2=481 12 N control AFFX-MurIL2_at 0 13 A T A 0 8161 -1 -1 99 I want to read the column mentioning 481 and leaving Cell?= portion. Then second col. ie 13/12, third col, 5th(AFFX-KurIL2_at) and 7th(13/13). Please suggest how do i do that. The code i tried is as follows: $writefilename = 'final.txt'; open(READFILE1,$writefilename); open(WRITEFILE1,cdf.txt); You should _ALWAYS_ verify that your files were opened correctly: open( READFILE1, $writefilename ) or die Cannot open $writefilename: $!; open( WRITEFILE1, cdf.txt ) or die Cannot open cdf.txt: $!; @array=READFILE1; $len=scalar(@array); print $len; #foreach $lineblock(@array){ # @colarray=split(/\w+\=\d+\s+\d+\s+\w\s+\w+\s+\w+\-\w+\-\w+\s+\d\s+\d+\s+\w\s+\w\s+\w\s+\d\s+\d+\s+\d\s+\d\s+\d+/, $lineblock); # print WRITEFILE1 @colarray[1]; #} foreach$lineblock(@array){ @colarray=split(/\s*/,$lineblock); You are telling split() to split on zero or more whitespace which is the same as splitting the string into individual characters and removing the whitespace. $ perl -le'print $_ for split /\s*/, one two' o n e t w o $colarray[0]=~ s/Cell\d=//ig; foreach $col(@colarray){ print WRITEFILE1 $col; } } According to your code, this should do the same thing: for ( @array ) { s/Cell\d=//i; s/\s+//g; print WRITEFILE1; } close READFILE1; close WRITEFILE1; exit; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parse text file and increment
Rmck wrote: Hello, Hello, I have a perl script that opens up a text file and displays the data fine. My textfile: 111.111.111.1-25|DEPTA 222.222.222.50-60|DEPTB What I would like to do is have it increment 1 through 25, and 50 through 60, and display that like so: SO FAR .. here is the data file hosts.dat: 111.111.111.444|DEPTA # DEPTB Stuff 222.222.222.1-15|DEPTB 222.222.222.20|DEPTB # DEPTC INFO 333.333.333.20-25|DEPTC # 444.444.44.555|DEPTF here is script create.pl: #!/usr/bin/perl -w while () { next if /^#/; # skip comments. if (/\b-\b/){ print; } } bash-2.03# ./create.pl host.dat 222.222.222.1-15|DEPTB 333.333.333.20-25|DEPTC bash-2.03# WHAT I NEED... So what im looking at doing is having IP's with - print out as so and to a new file: 222.222.222.1|DEPTB 222.222.222.2|DEPTB . . 222.222.222.15|DEPTB 333.333.333.20|DEPTC 333.333.333.21|DEPTC . . 333.333.333.25|DEPTC This should do what you want: while ( my $line = ) { next if $line =~ /^#/; # skip comments. if ( $line =~ s/(\d+-\d+)/%d/ ) { ( my $range = $1 ) =~ s/-/ .. /; printf $line, $_ for eval $range; } else { print; } } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reading columns from a file
Shahzad A Khalid wrote: I want to read the column mentioning 481 and leaving Cell?= portion. Then second col. ie 13/12, third col, 5th(AFFX-KurIL2_at) and 7th(13/13). Please suggest how do i do that. The code i tried is as follows: Try this: #!/usr/bin/perl -wlna print @F[0..2,4,6]; Usage: program input output If you're not sure if the input file always has at least 7 fields, than add the condition: #!/usr/bin/perl -wlna print @F[0..2,4,6] if @F 6; -zsdc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Executable perl program help!!
You may also want to look at the PAR module. It can create and executable, and it is available from ActiveState via ppm. Be aware that it packages the interpreter and modules with the script, so the executable can be very large, particularly with Tk. Another project I have heard good things about is tinyperl. I have been told that it give you executable perl on a floppy. I believe it is on Source Forge. --Rick - Original Message - From: Dan Muey [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 10:06 AM Subject: RE: Executable perl program help!! How can i generate such a file? # vi mysript.pl : #!/usr/bin/perl -w use strict; print hello\n; # ./myscript.pl Bash: Bad command or file name : Permission denied # chmod 755 myscript.pl # ./myscript.pl hello # On unix it has to be executable by the user running it, commonly 755 or on winders you have to have the file extension .pl associated with the perl binary which is usually done on installing Perl. HTH DMuey -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cron jobs and perl
Anytime you have problems with a cron, the easiest place to look first is in the cronlog. If you have root access, look at the file /var/cron/log (this is Solaris, other *nix may have it elsewhere). If you don't have root access, delete my E-mail and I apoligize for intruding. :-) In the cron log you will see if the command executed or if it failed out. You may also note you have mail, which may contain some useful info. (again, this is all from a Solaris point of view). Looking at your pasted entries, it looks ok, however running the .profile first may be causing problems. John -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 10:00 PM To: Dan Muey; Jeff Westman; beginners Subject: Cron jobs and perl Hi Dan The problem still persisits pls. help/suggest me what to do ? When iam executing the xapipgm.pl it is getting executed properly but when iam trying to execute thru crontab it is not xapipgm.pl ** #!/bin/sh #myrun.shell xapipgm=srvtst26.pl pgrep -f $xapipgm /dev/null # runrc=$? # echo Return Code is: $? if [ $? -eq 0 ] then set `pgrep -f $xapipgm ` echo AHD XAPI Server ($xapipgm) Running with Process Id: $1 else echo AHD XAPI Server is now Started Running on `date`.log/init/ahdxapi.init.$1$2$3.$4$5.log set `date '+%Y %m %d %H %M' ` xapipgm=srvtst26.pl perl -w $xapipgm log/init/ahdxapi.init.$1$2$3.$4$5.log 2log/init/ahdxapi.init.$1$2$3.$4$5.err #perl -w $4$5log/init/ahdxapi.init fi ** Cron tab settings are as follows * * * * * . /home/paradigm/.profile; /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log 21 _ Access permsissons Details In the following path i have /proj/ahd02/CAisd/site/mods/scripts-Xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init-ahdxapi.init.log and the access permission for log folder is drwxr-xr-x and init folder is drwxr-xr-x. And the log file name i.e (agdxapi.init.log) is -rwxrwxrwx rgds venkat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cron jobs and perl
thanx for ur suggestion m8,i went to /var/cron but when iam trying to go to log it is saying the following error ksh: log: not a directory -Original Message- From: Schubert, John [NTWK SVCS] [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2003 4:01 AM To: Vema Venkata; Dan Muey; Jeff Westman; beginners Subject: RE: Cron jobs and perl Anytime you have problems with a cron, the easiest place to look first is in the cronlog. If you have root access, look at the file /var/cron/log (this is Solaris, other *nix may have it elsewhere). If you don't have root access, delete my E-mail and I apoligize for intruding. :-) In the cron log you will see if the command executed or if it failed out. You may also note you have mail, which may contain some useful info. (again, this is all from a Solaris point of view). Looking at your pasted entries, it looks ok, however running the .profile first may be causing problems. John -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 10:00 PM To: Dan Muey; Jeff Westman; beginners Subject: Cron jobs and perl Hi Dan The problem still persisits pls. help/suggest me what to do ? When iam executing the xapipgm.pl it is getting executed properly but when iam trying to execute thru crontab it is not xapipgm.pl ** #!/bin/sh #myrun.shell xapipgm=srvtst26.pl pgrep -f $xapipgm /dev/null # runrc=$? # echo Return Code is: $? if [ $? -eq 0 ] then set `pgrep -f $xapipgm ` echo AHD XAPI Server ($xapipgm) Running with Process Id: $1 else echo AHD XAPI Server is now Started Running on `date`.log/init/ahdxapi.init.$1$2$3.$4$5.log set `date '+%Y %m %d %H %M' ` xapipgm=srvtst26.pl perl -w $xapipgm log/init/ahdxapi.init.$1$2$3.$4$5.log 2log/init/ahdxapi.init.$1$2$3.$4$5.err #perl -w $4$5log/init/ahdxapi.init fi ** Cron tab settings are as follows * * * * * . /home/paradigm/.profile; /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log 21 _ Access permsissons Details In the following path i have /proj/ahd02/CAisd/site/mods/scripts-Xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init-ahdxapi.init.log and the access permission for log folder is drwxr-xr-x and init folder is drwxr-xr-x. And the log file name i.e (agdxapi.init.log) is -rwxrwxrwx rgds venkat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cron jobs and perl
On AIX the file root is in /usr/spool/cron/crontabs which is linked to /var/spool/cron/crontabs. You could search for the cron files using find / -name cron* -print You might also be aware that there *MAY* be cron jobs for different users, e.g. in the cron directory there may be jobs which are run for the user adm or another user. However, for ease of maintenance, I've usually only seen a cron file for root. If the job has to run with permissions of an ordinary user, the cron job would read something like this: 15 7 * * 1-5 su - username -c /path/script /tmp/script.out 21 This would run at 7:15 am, Monday to Friday, switch user to username, adopting username's .profile and environmental variables (hence the - after the su) and then run the script /path/script. Output from the cron job would go to /tmp/script.out, including errors. Anthony English -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2003 2:47 PM To: Schubert, John [NTWK SVCS]; Dan Muey; Jeff Westman; beginners Subject: RE: Cron jobs and perl thanx for ur suggestion m8,i went to /var/cron but when iam trying to go to log it is saying the following error ksh: log: not a directory -Original Message- From: Schubert, John [NTWK SVCS] [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2003 4:01 AM To: Vema Venkata; Dan Muey; Jeff Westman; beginners Subject: RE: Cron jobs and perl Anytime you have problems with a cron, the easiest place to look first is in the cronlog. If you have root access, look at the file /var/cron/log (this is Solaris, other *nix may have it elsewhere). If you don't have root access, delete my E-mail and I apoligize for intruding. :-) In the cron log you will see if the command executed or if it failed out. You may also note you have mail, which may contain some useful info. (again, this is all from a Solaris point of view). Looking at your pasted entries, it looks ok, however running the .profile first may be causing problems. John -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 10:00 PM To: Dan Muey; Jeff Westman; beginners Subject: Cron jobs and perl Hi Dan The problem still persisits pls. help/suggest me what to do ? When iam executing the xapipgm.pl it is getting executed properly but when iam trying to execute thru crontab it is not xapipgm.pl ** #!/bin/sh #myrun.shell xapipgm=srvtst26.pl pgrep -f $xapipgm /dev/null # runrc=$? # echo Return Code is: $? if [ $? -eq 0 ] then set `pgrep -f $xapipgm ` echo AHD XAPI Server ($xapipgm) Running with Process Id: $1 else echo AHD XAPI Server is now Started Running on `date`.log/init/ahdxapi.init.$1$2$3.$4$5.log set `date '+%Y %m %d %H %M' ` xapipgm=srvtst26.pl perl -w $xapipgm log/init/ahdxapi.init.$1$2$3.$4$5.log 2log/init/ahdxapi.init.$1$2$3.$4$5.err #perl -w $4$5log/init/ahdxapi.init fi ** Cron tab settings are as follows * * * * * . /home/paradigm/.profile; /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log 21 _ Access permsissons Details In the following path i have /proj/ahd02/CAisd/site/mods/scripts-Xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init-ahdxapi.init.log and the access permission for log folder is drwxr-xr-x and init folder is drwxr-xr-x. And the log file name i.e (agdxapi.init.log) is -rwxrwxrwx rgds venkat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cron jobs and perl
au1544s: /var/cron ls -log total 3348 -rw--- 1 243691 Aug 21 14:48 log -rw--- 1 399268 Aug 21 00:01 log.0 -rw--- 1 451651 Aug 20 00:01 log.1 -rw--- 1 494912 Aug 19 00:01 log.2 -rw--- 1 75077 Apr 5 2002 log.3 when iam trying to view i dont have permissions -Original Message- From: Schubert, John [NTWK SVCS] [mailto:[EMAIL PROTECTED] Sent: Thursday, 21 August 2003 4:01 AM To: Vema Venkata; Dan Muey; Jeff Westman; beginners Subject: RE: Cron jobs and perl Anytime you have problems with a cron, the easiest place to look first is in the cronlog. If you have root access, look at the file /var/cron/log (this is Solaris, other *nix may have it elsewhere). If you don't have root access, delete my E-mail and I apoligize for intruding. :-) In the cron log you will see if the command executed or if it failed out. You may also note you have mail, which may contain some useful info. (again, this is all from a Solaris point of view). Looking at your pasted entries, it looks ok, however running the .profile first may be causing problems. John -Original Message- From: Vema Venkata [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 10:00 PM To: Dan Muey; Jeff Westman; beginners Subject: Cron jobs and perl Hi Dan The problem still persisits pls. help/suggest me what to do ? When iam executing the xapipgm.pl it is getting executed properly but when iam trying to execute thru crontab it is not xapipgm.pl ** #!/bin/sh #myrun.shell xapipgm=srvtst26.pl pgrep -f $xapipgm /dev/null # runrc=$? # echo Return Code is: $? if [ $? -eq 0 ] then set `pgrep -f $xapipgm ` echo AHD XAPI Server ($xapipgm) Running with Process Id: $1 else echo AHD XAPI Server is now Started Running on `date`.log/init/ahdxapi.init.$1$2$3.$4$5.log set `date '+%Y %m %d %H %M' ` xapipgm=srvtst26.pl perl -w $xapipgm log/init/ahdxapi.init.$1$2$3.$4$5.log 2log/init/ahdxapi.init.$1$2$3.$4$5.err #perl -w $4$5log/init/ahdxapi.init fi ** Cron tab settings are as follows * * * * * . /home/paradigm/.profile; /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log 21 _ Access permsissons Details In the following path i have /proj/ahd02/CAisd/site/mods/scripts-Xapipgm.pl /proj/ahd02/CAisd/site/mods/scripts/log/init-ahdxapi.init.log and the access permission for log folder is drwxr-xr-x and init folder is drwxr-xr-x. And the log file name i.e (agdxapi.init.log) is -rwxrwxrwx rgds venkat -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
create log as well as print on screen
Hi All, I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) Thanx in advance Mark ___ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File::Copy CGI.pm
HiHi~ If you are transfering file from a local machine to a remote machine, you do not use File::Copy module to copy files. File::Copy is used for copying files locally. You can use Net::FTP to transfer files from one machine to another. And of course, you will need a FTP server for the machine receiving the file. Bye~ Yupapa ### # Yupapa Web Hosting =^.^= # Web Site - http://www.yupapa.com # Email - [EMAIL PROTECTED] ### B. Fongo [EMAIL PROTECTED] ???:[EMAIL PROTECTED] Hi, I've a small script intended for file transfer from a windows machine to a remote linux server. To implement that, I decided to use two module i.e File::Basename, File::Copy and CGI.pm. The File::Copy is working well locally, but it fails to copy files to a remote machine through the Browser. I use CGI.pm to generate a form where users could browser and select a file to be transferred. The error message is always: No such file or directory though the file or directory exist and permission is set 777. What may be the case? Any suggestion on how to transfer file to remote location? I'm not sure whether it will be applicable to use file handles and use a loop to read the files from the source location and write them to a destination folder. Thanks for any help ## #!/usr/bin/perl -w use strict; use CGI qw/ :standard/; my $cgi = new CGI; use File::Basename; if( param()){ upload_file(param(upload_file)); } else { print_form(); } Subroutine to transfer file ### sub upload_file{ my ($file, $file_destination, $file_name, $forwarded_value); $original_src = $forwarded_value = $_[0]; $file_destination = q(/data/Software_Pakete); $forwarded_value =~ s/\\/\//g; $file_name = basename($forwarded_value); if (copy($original_src,$file_destination/$file_name)){ print_success() } else{ print_error($forwarded_value,$file_destination/$file _name) } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: create log as well as print on screen
old_script.pl | perl -e while () {print $_; warn $_} 2 $logFile Or redefine the print -Original Message- From: mark sony [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 3:11 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: create log as well as print on screen Hi All, I wrote a script which is running perfectly fine providing many outputs on the screen . Only glitch is that it does not print in a log file . Now what I want is that it would print on the screen as well as create a log file . At the end of the program I will output that the above output can also be seen at the $log_File_position . Hope I am clear with my question . Any type of pointers and I would be over the moon ;) Thanx in advance Mark ___ Meet your old school or college friends from 1 Million + database... Click here to reunite www.batchmates.com/rediff.asp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]