Re: Emptying a log file....

2005-08-12 Thread Octavian Rasnita
Hi, See: perldoc -f truncate Teddy - Original Message - From: "Tony Frasketi" <[EMAIL PROTECTED]> To: Sent: Friday, August 12, 2005 2:33 AM Subject: Emptying a log file > Hello Listers > > Is there any way in perl to effectively clear the contents of an > ***existing*** file

Re: Emptying a log file....

2005-08-12 Thread Octavian Rasnita
Or... another non-perl solution: echo "" > log.txt Teddy - Original Message - From: "Bryan R Harris" <[EMAIL PROTECTED]> To: "Beginners Perl" Sent: Friday, August 12, 2005 2:54 AM Subject: Re: Emptying a log file > > > Not a perl solution, but: > > cp /dev/null myfile > > - B

Debugging AUTOLOAD functions

2005-08-12 Thread lohit
Hello everyone, I am trying to debug perl code. A function call is autoloaded and when i step into it, it takes me to perl AUTOLOAD call, returning from there gets me back to main file executing the funtion. Is there any special settings/procedure i should follow? thanks in advance, lohit

Sub-routine arguments

2005-08-12 Thread Praveen Rajendra Babu
Hi All, I really don't understand why it works this way. Any help will be greatly appreciated. Many thanks in advance. Below is a call to a sub-routine add_send_messages. This sub-routine in turn calls others and ultimately an e-mail is sent via "sendmail". If the third line is changed t

Open java source file and change headers

2005-08-12 Thread David McGee
Hello All, I'm trying to come up with a solution for changing headers in my java source tree. Its been suggested to use Perl because it is good with text. Does anyone have any input or ideas? Thanks, mcgee

Re: Sub-routine arguments

2005-08-12 Thread Jeff 'japhy' Pinyan
On Aug 12, Praveen Rajendra Babu said: Below is a call to a sub-routine add_send_messages. This sub-routine in turn calls others and ultimately an e-mail is sent via "sendmail". If the third line is changed to: Page Level Alerting Going Second One :: $page_name i.e. moving the $page_name varia

Puzzle: Know Your Data

2005-08-12 Thread Jeff 'japhy' Pinyan
Here's an interesting exercise for beginners. You have an array of strings, and you want to sort them but in a case-insensitive manner. You are doing this in two different places in your code. In one place, you write: # convert the strings to lowercase when comparing my @sorted = sort {

Re: Emptying a log file....

2005-08-12 Thread Tony Frasketi
Hello Listers Thanks very much for all the suggestions for solving my problem with clearing out my log file I've followed the suggestion by [EMAIL PROTECTED] and it does the job for me... --- open FD, ">filename"; --- What a gr

A simple perl script

2005-08-12 Thread Stephen Liu
Hi folks, I'm prepared to write a simple perl scripts as follow There are 25 commands executed in following sequence; export LFS=/mnt/lfs mount /dev/hda6 /mnt/lfs mkdir -p $LFS echo $LFS /mnt/lfs (output) /usr/sbin/chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/b

Re: Puzzle: Know Your Data

2005-08-12 Thread Ugly Virgin
Jeff 'japhy' Pinyan wrote: Here's an interesting exercise for beginners. You have an array of strings, and you want to sort them but in a case-insensitive manner. You are doing this in two different places in your code. In one place, you write: # convert the strings to lowercase when com

Misuse of "use"?

2005-08-12 Thread Randy Macdonald
(I posted this to the beginning_perl group on Yahoo groups, but the two- hour wait trie my patience. My apologies if this meesage is not new for some of you all.) --- Folks; This is #1 of I'm sure many Perl questions. Thanks to all who help in advance. I

Re: Misuse of "use"?

2005-08-12 Thread Jeff 'japhy' Pinyan
On Aug 12, Randy Macdonald said: However, when I run: print ''; use NotARealPackage; print ''; I expect to get: but I get no output at all. Why is this? The 'use' statement is special to Perl. It is executed at compile-time, not at run-time like most of the rest of your code. Because o

Re: Puzzle: Know Your Data

2005-08-12 Thread Graeme St.Clair
Hmm. I'm glad UV came up with h[er|is] solution, as mine was going to be similar, but involving the German double s that looks (sort of) like a Greek beta. Neither UV's solution nor mine showed the "feature" on Windows XP SP2 plus:- This is perl, v5.8.4 built for MSWin32-x86-multi-thread (wi

Re: Misuse of "use"?

2005-08-12 Thread Manav Mathur
> On Aug 12, Randy Macdonald said: > > > However, when I run: > > > > print ''; > > use NotARealPackage; > > print ''; > > > > I expect to get: > > > > > > > > but I get no output at all. Why is this? > > The 'use' statement is special to Perl. It is executed at compile-time, > not at run-time li