Re: why not die?

2005-10-20 Thread John W. Krahn
Beast wrote: > #!/usr/bin/perl > use strict; > > my $log = '/non/existence/dir/test.log'; > my $msg = "test"; > &write_log($msg); > > sub write_log { >my $msg = shift; >open LOG, ">>$log" || die "Can't write to $log: $!\n"; > print LOG $msg; >close LOG; > } > > --- > > It does

Re: why not die?

2005-10-20 Thread Xavier Noria
On Oct 21, 2005, at 8:39, Beast wrote: #!/usr/bin/perl use strict; my $log = '/non/existence/dir/test.log'; my $msg = "test"; &write_log($msg); sub write_log { my $msg = shift; open LOG, ">>$log" || die "Can't write to $log: $!\n"; This is a gotcha, it is parsed like this: open LO

why not die?

2005-10-20 Thread Beast
#!/usr/bin/perl use strict; my $log = '/non/existence/dir/test.log'; my $msg = "test"; &write_log($msg); sub write_log { my $msg = shift; open LOG, ">>$log" || die "Can't write to $log: $!\n"; print LOG $msg; close LOG; } --- It doesn't die or print any error even $log did not e

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Franklin
Thanks you very much for your kind help! On 10/20/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Franklin wrote: > > Hi: > > Hello, > > > I am a real beginner of perl. after looking for Internet for serveral > > hours, I still can't find the answers for my problem. My question is: > > Which functi

Removing specific lines from a File

2005-10-20 Thread Rose, Jeff
I know there is a better way to go about this but for some reason the solution escapes me. Basically what I am trying to do here is parse through an email file grab the the basics, from/to/subject put those in a small text tab separated database in the format of File NumRecipients From FromIP

RE: Simultaneous access: Perl (DBD::ODBC) and C# (ODBC)

2005-10-20 Thread Timothy Johnson
I have two suggestions: One is to go to http://dbi.perl.org and sign up for the dbi-users mailing list. Two is just a thought, but have you tried using DBD::ADO instead of DBD::ODBC? -Original Message- From: Siegfried Heintze [mailto:[EMAIL PROTECTED] Sent: Thursday, October 20, 2005

Simultaneous access: Perl (DBD::ODBC) and C# (ODBC)

2005-10-20 Thread Siegfried Heintze
I'm using perl on a windows machine. I have a perl batch process populating an MSAccess database and a ASPX C# front end reading from the (same) MSAccess database. The ASPX/C# works fine as long as there is not a perl program trying to populate the database. If there is a perl program populating t

Re: Config File Layout

2005-10-20 Thread Wiggins d'Anconia
Ryan Frantz wrote: > Perlers, > > > > I'm working on a script that will need to email clients if it finds > files in their respective outbound directories. I've decided on a > simple config file: > > > > [foo] > > [EMAIL PROTECTED] > > > > [bar] > > [EMAIL PROTECTED] > > [EMAIL PROT

Config File Layout

2005-10-20 Thread Ryan Frantz
Perlers, I'm working on a script that will need to email clients if it finds files in their respective outbound directories. I've decided on a simple config file: [foo] [EMAIL PROTECTED] [bar] [EMAIL PROTECTED] [EMAIL PROTECTED] I've written a simple parser but it doesn't che

RE: HTAB, VTAB in a terminal?

2005-10-20 Thread Ryan Frantz
> -Original Message- > From: Bryan R Harris [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 20, 2005 3:02 PM > To: Beginners Perl > Subject: Re: HTAB, VTAB in a terminal? > > > > >>> Curses is a CPAN module, correct? > >>> > >>> I have an office-full of users here, most of which wi

Re: HTAB, VTAB in a terminal?

2005-10-20 Thread Bryan R Harris
>>> Curses is a CPAN module, correct? >>> >>> I have an office-full of users here, most of which will not not have that >>> module installed on their workstations. What's the best way to do something >>> like that? Can I have my perl script install that module on their machines? >>> Or can I s

RE: HTAB, VTAB in a terminal?

2005-10-20 Thread Ryan Frantz
> -Original Message- > From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 20, 2005 2:22 PM > To: Bryan R Harris > Cc: Beginners Perl > Subject: Re: HTAB, VTAB in a terminal? > > On Oct 20, Bryan R Harris said: > > > Curses is a CPAN module, correct? > > > > I

Re: HTAB, VTAB in a terminal?

2005-10-20 Thread Jeff 'japhy' Pinyan
On Oct 20, Bryan R Harris said: Curses is a CPAN module, correct? I have an office-full of users here, most of which will not not have that module installed on their workstations. What's the best way to do something like that? Can I have my perl script install that module on their machines? O

Re: HTAB, VTAB in a terminal?

2005-10-20 Thread Bryan R Harris
> On Oct 20, Bryan R Harris said: > >> I'd like to write a perl script to do very simple bitmap editing. The part >> I can't figure out is how to write text into the terminal at any x,y point. >> Is this possible? >> >> e.g. how can I write an "*" at 10 columns over, 5 rows down in the current

Re: HTAB, VTAB in a terminal?

2005-10-20 Thread Jeff 'japhy' Pinyan
On Oct 20, Bryan R Harris said: I'd like to write a perl script to do very simple bitmap editing. The part I can't figure out is how to write text into the terminal at any x,y point. Is this possible? e.g. how can I write an "*" at 10 columns over, 5 rows down in the current terminal? The Cu

HTAB, VTAB in a terminal?

2005-10-20 Thread Bryan R Harris
I'd like to write a perl script to do very simple bitmap editing. The part I can't figure out is how to write text into the terminal at any x,y point. Is this possible? e.g. how can I write an "*" at 10 columns over, 5 rows down in the current terminal? TIA. - Bryan -- To unsubscribe, e-

Re: Carriage Return and LineFeeds Question

2005-10-20 Thread Jeff 'japhy' Pinyan
On Oct 20, Dave Adams said: I am having troubles understanding how perl sees carriage returns and line feeds. I am not sure if it is a windows and unix thing. *Scenario:* I have a HTML form that uploads a text file (via a POST) to a unix server who then passes it to a perl cgi. This cgi parses

Re: Need Some Guidance

2005-10-20 Thread Wiggins d'Anconia
Gladstone Daniel - dglads wrote: > I noticed that there is various version of > > Learning Perl + Perl Cookbook > > The most version (Version 4) costs the most. Does it matter the version > if > I want to learn or do I need to get the most recent version? > > What is the groups thoughts? >

Re: Project planning

2005-10-20 Thread Wiggins d'Anconia
Steve Bertrand wrote: > Hi everyone, > > This question may seem odd, but here goes anyway. > > I've been working at an ISP for a few years now, and have been adding > to/modifying their current accounting system since I've got here. Of > course it is all Perl based. > > This isn't a technical pr

Project planning

2005-10-20 Thread Steve Bertrand
Hi everyone, This question may seem odd, but here goes anyway. I've been working at an ISP for a few years now, and have been adding to/modifying their current accounting system since I've got here. Of course it is all Perl based. This isn't a technical problem I'm having, but the system has wel

Carriage Return and LineFeeds Question

2005-10-20 Thread Dave Adams
I am having troubles understanding how perl sees carriage returns and line feeds. I am not sure if it is a windows and unix thing. *Scenario:* I have a HTML form that uploads a text file (via a POST) to a unix server who then passes it to a perl cgi. This cgi parses through the file, puts it in an

Re: Need a help on this Script

2005-10-20 Thread John W. Krahn
Mazhar wrote: > Folks, Hello, > I am a software developer and I have a written a script which will read the > configuration like to address, subject of the mail and the threshold value. > After reading the three values from the config file i will query the > database and the result of the query i

Re: net::google problem

2005-10-20 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Thursday, October 20, 2005 at 09:34 (-0400 (EDT)) wrote about: JP> Stop right there! See the [ at the beginning of the dumped representation JP> of $response? That means $response is an array reference. It *holds* JP> objects, but it isn't an object itself. yes, th

Net::FTP tip

2005-10-20 Thread kathyjjja
Hello, Thank you for pointing out that I forgot the semi-colon after $ftp->ascii. The program works fine now. I was having a problem with the file format being altered. I am moving a file from VMS to Windows. First thing I learned is that you have to use $ftp->binary AFTER you login! Also, I t

Re: net::google problem

2005-10-20 Thread Jeff 'japhy' Pinyan
On Oct 20, Ing. Branislav Gerzo said: use strict; use warnings; use Net::Google; [snip] my $response = $session->response(); I dumped response, and beginning is: $VAR1 = [ bless( { Stop right there! See the [ at the beginning of the dumped representation of $response? That mea

Re: Thank you for your answer. And yesterday i was write from Nahid`s email address

2005-10-20 Thread Chris Devers
On Thu, 20 Oct 2005 [EMAIL PROTECTED] wrote: Hello. Please help me write this script. Before this mail i sent to you amil, and i explained what i need. Thank you very much in advance. This list continues not to be a free script writing service. Sorry. Additionally, many of the people on the

net::google problem

2005-10-20 Thread Ing. Branislav Gerzo
Hi pals, I have this naughty problem, and I am stuck: use strict; use warnings; use Net::Google; use constant LOCAL_GOOGLE_KEY => "mykey"; my $service = Net::Google->new(key=>LOCAL_GOOGLE_KEY); my $session = $service->search(); $session->query(qw(Perl modules)); my $response = $session->respo

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread John W. Krahn
Franklin wrote: > Hi: Hello, > I am a real beginner of perl. after looking for Internet for serveral > hours, I still can't find the answers for my problem. My question is: > Which function I can use to get 2 digits after point for a variable? > For example, for $j=2.56789, how can I get the very

Re: Thank you for your answer. And yesterday i was write from Nahid`s email address

2005-10-20 Thread Ulfet
Hello.   Please help me write this script. Before this mail i sent to you amil, and  i explained what i need. Thank you very much in advance.

Re: CGI changes

2005-10-20 Thread Xavier Noria
On Oct 20, 2005, at 9:24, Kamalraj Singh Madhan, Noida wrote: Now I want to add the current date to the name of the zipped up file i.e. to the variable named 'filen' in the above script... Is there any date function in shell scripting which can solve this problem? Kindly suggest. Yes, you can

Re: [SPAM DETECT] how to get defined number of digits after point of a variable

2005-10-20 Thread Xavier Noria
On Oct 20, 2005, at 9:07, Franklin wrote: I am a real beginner of perl. after looking for Internet for serveral hours, I still can't find the answers for my problem. My question is: Which function I can use to get 2 digits after point for a variable? For example, for $j=2.56789, how can I get th

Need a help on this Script

2005-10-20 Thread Mazhar
Folks, I am a software developer and I have a written a script which will read the configuration like to address, subject of the mail and the threshold value. After reading the three values from the config file i will query the database and the result of the query i am genearting a report and the s

Re: Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Beau E. Cox
Hi Wijaya Edward - At 2005-10-19, 21:18:16 you wrote: > >> Hi: > >Hi >> For example, for $j=2.56789, how can I get the very first two digits >> after points,ie, I just want to get 2.56. >> Thank you very much in advance. >> > >Is this what you want? > >$ perl -e '$j = 2.56789; $j =~ /(\d\.\d\d)

CGI changes

2005-10-20 Thread Kamalraj Singh Madhan, Noida
Hi Guys, I have a cgi which automates the task of zipping up a complete directory and its sub directories: echo "Content-type: text/html" echo "" echo "" echo "" echo "Building tar file..." echo "" cd /var/www/html/ for type in test; do filen=${type//\//-} echo "Building ${filen}.tgz " tar c

Re: how to get defined number of digits after point of a variable

2005-10-20 Thread Wijaya Edward
> Hi: Hi > For example, for $j=2.56789, how can I get the very first two digits > after points,ie, I just want to get 2.56. > Thank you very much in advance. > Is this what you want? $ perl -e '$j = 2.56789; $j =~ /(\d\.\d\d)+/; $ns = $1; print "$ns\n";' prints: 2.56 Read: perldoc perlretut.

how to get defined number of digits after point of a variable

2005-10-20 Thread Franklin
Hi: I am a real beginner of perl. after looking for Internet for serveral hours, I still can't find the answers for my problem. My question is: Which function I can use to get 2 digits after point for a variable? For example, for $j=2.56789, how can I get the very first two digits after points,ie,