RE: Running Perl programs on a machine that does not have Perl installed

2003-06-24 Thread NYIMI Jose (BMB)
Check out ActiveState's PerlApp that comes with their Perl Dev Kit. It does a very good job of packaging your Perl scripts in a compressed executable that will extract and then run the script without Perl having to be installed on the target machine. There is also a product called perl2exe which

Perl Best Practices

2003-06-24 Thread NYIMI Jose (BMB)
Hello, I'm looking for a link where i can find information about Perl's best practices programming. Thanks in advance. === José Nyimi Mbambi IT Analyst http://www.proximus.be DISCLAIMER "This e-mail and any attachment thereto may contain information which is c

RE: Perl Best Practices

2003-06-24 Thread NYIMI Jose (BMB)
Here are some best practices i know: 1. use warnings or -w 2. use strict; Could you extends the list please ? José. -Original Message- From: NYIMI Jose (BMB) Sent: Tuesday, June 24, 2003 8:58 AM To: [EMAIL PROTECTED] Subject: Perl Best Practices Hello, I'm looking for a link where

Re: Perl Best Practices

2003-06-24 Thread Steve Grazzini
On Tue, Jun 24, 2003 at 09:17:10AM +0200, NYIMI Jose (BMB) wrote: > Here are some best practices i know: > 1. use warnings or -w > 2. use strict; > > Could you extends the list please ? Those are probably the most important. :-) And from the making-best-use-of-available-resources dept: 3. us

Calculating Disk Space and Freespace on Windows

2003-06-24 Thread Denham Eva
Hello, I'd appreciate any suggestions on how to calculate Disk space and Free Space. Many Thanks Denham Eva Oracle DBA Linux like TeePee... No Windows, No Gates and Apache inside! _ This e-mail message has been

Re: Help needed on XML Files

2003-06-24 Thread Janek Schleicher
Sherwin Remo wrote at Tue, 24 Jun 2003 06:56:40 +0800: > I would like to write a script that would check the correct syntax of an XML > file. Need to check if the file is XML compliant. Is there a module that I > can use to do this? Thanks! There are a lot of XML modules on CPAN: http://search

context, printing, and concatenation

2003-06-24 Thread Peter
I'm on the first few chapters of "Learning Perl" and came up with a question. Given: - @array = qw ( one two three ); print @array . "\n"; print @array; - Why does the first print statement print "3" (and a carriage return)

CPAN question: configuration of get mechanism?

2003-06-24 Thread Travis J.I. Corcoran
Hi. I'm a new Perl programmer and CPAN user. Here's my problem: When I try to use CPAN to fetch something, all the normal mechanisms time out, and then I get down to ncftpget, which works. I'm not behind a firewall, so I would have thought that LWP would work (as a matter of fact, I've written

Re: Perl Best Practices

2003-06-24 Thread Sudarshan Raghavan
Nyimi Jose wrote: Hello, I'm looking for a link where i can find information about Perl's best practices programming. For starters you can take a look at these docs perldoc perlstyle perldoc perltrap perldoc perlmodstyle #If you are interested in developing modules Thanks in advance. ==

RE: context, printing, and concatenation

2003-06-24 Thread NYIMI Jose (BMB)
Because in the first statement @array is used in scalar context so it's like you wrote something as [EMAIL PROTECTED]; print $size."\n"; That's why you get the number of items contained in @array which is 3. HTH, José. -Original Message- From: Peter [mailto:[EMAIL PROTECTED] Sent: Tue

RE: Help needed on XML Files

2003-06-24 Thread EUROSPACE SZARINDAR
Hello, There are a lot of perl modules dealing with the XML. The most common is XML::Parser which will surely do whatever you want and perhaps a litle more. XML::Simple is also very useful for Simple XML treatment. Just go to CPAN web site. Michel -Message d'origine- De: Remo, Sherwi

Parsing .csv file

2003-06-24 Thread Sparrow, Dave
I'm reading an Excel .csv file. Fields are separated by commas. If a field contains a comma, the whole field is double-quoted (Excel does this by default). An example of an input line is as follows: field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6 I want to get each fiel

Re: Parsing .csv file

2003-06-24 Thread Sudarshan Raghavan
Sparrow, Dave wrote: I'm reading an Excel .csv file. Fields are separated by commas. If a field contains a comma, the whole field is double-quoted (Excel does this by default). An example of an input line is as follows: field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6

searching the solution

2003-06-24 Thread Gayatri
Hi I am writing a perl scipt in that I want to change the dir to some other and run a exe from there is it possible? Because chdir is not working there. Thanks and Regards -Gayatri - Original Message - From: Sparrow, Dave To: [EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 3:46

Re: searching the solution

2003-06-24 Thread Sudarshan Raghavan
Gayatri wrote: Hi Please start a new thread to ask a question I am writing a perl scipt in that I want to change the dir to some other and run a exe from there is it possible? Yes it is possible, it is also possible to do that without changing to that directory Because chdir is not working t

RE: Parsing .csv file

2003-06-24 Thread Rai,Dharmender
you can get modules from cpan.perl.org > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Confidential: This electronic message and all contents contain information from Syntel, Inc. whi

Re: Parsing .csv file

2003-06-24 Thread George P.
On Tue, 24 Jun 2003, Sparrow, Dave wrote: > I'm reading an Excel .csv file. > Fields are separated by commas. > If a field contains a comma, the whole field is double-quoted (Excel does > this by default). > An example of an input line is as follows: > > field1,field2,"field3a, field3b, field3c

Re: searching the solution

2003-06-24 Thread Sudarshan Raghavan
Gayatri wrote: Please reply to the list thanks for ur suggetions I am sorry u told me to start new thread. i donot know how to start in a new thread. Just address your email with the question to [EMAIL PROTECTED] I didnot mean chdir() is not working. I am not able to run the file from that d

Hi

2003-06-24 Thread Gayatri
Thanks I got a solution. I was doing a silly mistake. chdir I was executing thro' system command like cd. Now it works. thanks for solutions Thanks and Regards -Gayatri DISCLAIMER** This e-mail and any attachment is for authorised u

Re: Calculating Disk Space and Freespace on Windows

2003-06-24 Thread Jenda Krynicky
From: Denham Eva <[EMAIL PROTECTED]> > I'd appreciate any suggestions on how to calculate Disk space and Free > Space. use Win32::FileOp; ($free_for_user, $total_space, $total_free) = GetDiskFreeSpace('C:'); You may install Win32::FileOp with PPM from http://Jenda.Krynicky.cz/perl c:\> ppm ppm>

Re: Running Perl programs on a machine that does not have Perl installed

2003-06-24 Thread Jenda Krynicky
From: "Dave Mamanakis" <[EMAIL PROTECTED]> > I have a perl program that I need to be able to run on all kinds of > machines. However, I cannot install perl on each of these machines. It > has to be run locally, not over a network (too many issues with > security) How can this be done? I know with s

Cookies rejected

2003-06-24 Thread Aman Thind
Hi All On receiving no reply to my previous post, I myself struggled a bit and came up with the following code to login to the site : -- use LWP::UserAgent; use HTTP::Cookies; $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->

Re: reading file into hash?

2003-06-24 Thread Tim McGeary
This works great, except when I do: for (keys %codes_hash) { print "$_|$codes_hash{$_}\n"; } for my own confirmation, I'm getting a blank line in the printout. I re-checked my config file and made sure there was not an extra blank line at the end of the file. Do you have any ideas why it woul

Re: reading file into hash?

2003-06-24 Thread Sudarshan Raghavan
Tim McGeary wrote: This works great, except when I do: for (keys %codes_hash) { print "$_|$codes_hash{$_}\n"; } for my own confirmation, I'm getting a blank line in the printout. I re-checked my config file and made sure there was not an extra blank line at the end of the file. Do you have

RE: reading file into hash?

2003-06-24 Thread Dan Muey
> This works great, except when I do: > > for (keys %codes_hash) { > print "$_|$codes_hash{$_}\n"; > } > > for my own confirmation, I'm getting a blank line in the > printout. I re-checked my config file and made sure there > was not an extra blank line at the end of the file. Do you >

multi-line matches / named.conf parsing

2003-06-24 Thread Kevin Pfeiffer
Hi all, In comp.unix.shell Alan Murrell posted this clever sed solution for removing entries from his named.conf file using only the domain name): sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile Instead of using actual line numbers for the range of lines (such as "1,4") he uses two

RE: Perl Best Practices

2003-06-24 Thread Tony Esposito
Maybe consider: use diagnostics; as well, at least while you are developing your code. Thanks! :-) > Anthony (Tony) Esposito > Senior Technical Consultant > Inovis(tm) > 2425 N. Central Expressway, Suite 900 > Richardson, TX 75080 > (972) 643-3115 > [EMAIL PROTECTED] > -Original Me

Re: multi-line matches / named.conf parsing

2003-06-24 Thread Paul Johnson
Kevin Pfeiffer said: > In comp.unix.shell Alan Murrell posted this clever sed solution for > removing entries from his named.conf file using only the domain name): > > sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile > > Instead of using actual line numbers for the range of lines (such

RE: reading file into hash?

2003-06-24 Thread Paul Johnson
Dan Muey said: >> my %codes_hash = (); > > Change this to my %codes_hash; > the = () is adding an empty key/value Are you sure? -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: reading file into hash?

2003-06-24 Thread Tim McGeary
Yah - that didn't work. It still would have needed the chomp; Tim Paul Johnson wrote: Dan Muey said: my %codes_hash = (); Change this to my %codes_hash; the = () is adding an empty key/value Are you sure? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

RE: multi-line matches / named.conf parsing

2003-06-24 Thread Dan Muey
> Hi all, Howdy, > > In comp.unix.shell Alan Murrell posted this clever sed > solution for removing > entries from his named.conf file using only the domain name): > > sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile > > Instead of using actual line numbers for the range of lines

RE: multi-line matches / named.conf parsing

2003-06-24 Thread Dan Muey
> > sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile > > > > Instead of using actual line numbers for the range of lines (such as > > "1,4") he uses two regexes that match to them. > > > > How might one do this in Perl? > > Just the same way: > > perl -ne 'print unless /zone "domain.co

RE: Parsing .csv file

2003-06-24 Thread Sparrow, Dave
> Take a look at Text::CSV or Text::CSV_XS Ah, but here's the kicker... Most people who I will give this script to will be running Perl 5.6 and WILL NOT have the ability to use any external modules, even those such as 'use strict' ! This is because they will be running a cut-down version of Perl th

RE: reading file into hash?

2003-06-24 Thread Dan Muey
> Yah - that didn't work. It still would have needed the chomp; > Then it must be getting added from the a blank line (IE ^\n$ or somilar) in the file. > Tim > > Paul Johnson wrote: > > Dan Muey said: > > > > > >>>my %codes_hash = (); > >> > >>Change this to my %codes_hash; > >>the = () is

RE: reading file into hash?

2003-06-24 Thread Dan Muey
> Dan Muey said: > > >> my %codes_hash = (); > > > > Change this to my %codes_hash; > > the = () is adding an empty key/value > > Are you sure? I assumed (I know I know one shouldn't assume ;p) that since I've had the same issue and once I changed my %hash = (); to my %hash; the empty key/valu

Re: multi-line matches / named.conf parsing

2003-06-24 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Paul Johnson wrote: > > Kevin Pfeiffer said: > >> In comp.unix.shell Alan Murrell posted this clever sed solution for >> removing entries from his named.conf file using only the domain name): >> >> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile >> >>

Use of Perl for global changes

2003-06-24 Thread Peter Goggin
I have two web sites with about 300 htm and php files. I wish to make a change so tht the database connect string in all of these files is changed for mysql_pconnect to mysql_connect. Can perl do this and if so can anyone show me how? Ideally I would like to feed a script or command line with a

RE: basic question: handling input to TCP/IP server

2003-06-24 Thread McMahon, Christopher x66156
This worked great. I had to tweak it a *little* bit because I'm after a slightly different thing, but I am now happily printing data from the client to STDOUT (and understanding how that works, too). BTW, this TCP/IP server is a test tool for some brokerage software. A few more

RE: Use of Perl for global changes

2003-06-24 Thread Bakken, Luke
cd /whatever dir perl -i.bak -pe's/\bmysql_pconnect\b/mysql_connect/g' * If everything is OK, delete the *.bak files. Luke > -Original Message- > From: Peter Goggin [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 24, 2003 8:08 AM > To: [EMAIL PROTECTED] > Subject: Use of Perl for global

RE: Parsing .csv file

2003-06-24 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Dave Sparrow wrote: >> Take a look at Text::CSV or Text::CSV_XS > Ah, but here's the kicker... > Most people who I will give this script to will be running Perl 5.6 and > WILL NOT have the ability to use any external modules, even those such as > 'use strict' ! > T

Weekly list FAQ posting

2003-06-24 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to <[EMAIL PROTECTED]> You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

RE: Calculating Disk Space and Freespace on Windows

2003-06-24 Thread Bakken, Luke
You want Win32::DriveInfo > -Original Message- > From: Denham Eva [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 24, 2003 12:42 AM > To: BeginnersPerl (E-mail); Perl-Beginner (E-mail) > Subject: Calculating Disk Space and Freespace on Windows > > > Hello, > > I'd appreciate any sugges

RE: Use of Perl for global changes

2003-06-24 Thread Dan Muey
> I have two web sites with about 300 htm and php files. I wish > to make a change so tht the database connect string in all of > these files is changed for mysql_pconnect to mysql_connect. > Can perl do this and if so can anyone show me how? > > Ideally I would like to feed a script or comma

Help needed

2003-06-24 Thread Shishir K. Singh
Hello, I have to get the size and last modified date of a remote file via URL without reading in the whole file. I have gone through LWP::UserAgent but couldn't make much headway. Any pointers on how to do it would be appreciated. TIA Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Odd Display using Perl5.8 in Debug

2003-06-24 Thread Jeff Westman
Hi, I have sort of a strange problem, and if anyone has a fix for it, please let me know. I don't know if this is perl-related or my software package. I am using 'Reflection X' for telneting. It's a great communications package, witht he exception of one annoying nuance. When I am debugging a

Re: using FIle::Find::name if regex to filter

2003-06-24 Thread David Storrs
On Mon, Jun 23, 2003 at 09:14:25PM +0200, [EMAIL PROTECTED] wrote: > hi, how can i use a real regex with this: > > File::Find::name if -x? > > the filetestops are working fine, but how can i filter things like > .gz$? i tried many ways, but all failed. any idea? thanks!! > > bye andreas Andreas

How do I find URL file size/last modified date

2003-06-24 Thread Shishir K. Singh
Hello, I have to get the size and last modified date of a remote file via URL without reading in the whole file. I have gone through LWP::UserAgent but couldn't make much headway. Any pointers on how to do it would be appreciated. TIA Shishir -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

help sending hex EOL chars

2003-06-24 Thread McMahon, Christopher x66156
Hi... My TCP/IP server is printing input fine, now I'm trying to send the right output. The client for my server expects an EndOfLine character that is a hex 0D0A. (zero-dee-zero-ay) My code is doing this: my $eol = "\x{0D0A}"; but the client is seeing this: E0B4 8A An

Binary file conversion

2003-06-24 Thread Ned Cunningham
HI all. I have what appears to be a C++ file set (i.e. phone.dat, phone.idx). My question is can Perl read these files and what modules do I need to do it. Any starting help would be great. Thankx Ned Cunningham POS Systems Developer Monro Muffler Brake & Service 200 Holleder Parkway Rocheste

Re: Help needed

2003-06-24 Thread Jenda Krynicky
From: "Shishir K. Singh" <[EMAIL PROTECTED]> > I have to get the size and last modified date of a remote file via > URL without reading in the whole file. I have gone through > LWP::UserAgent but couldn't make much headway. Any pointers on how to > do it would be appreciated. Try to use HEAD re

Cut, paste in Tk800.024

2003-06-24 Thread Doug Lentz
I'm doing a "simple" form using Tk. Things are going well, but I feel a little lazy, so for once I will ask about this. Perl/Tk script is running on linux box "host". Users are on windows boxes "local", running the application via an X server (Hummingbird Exceed) and the "export DISPLAY" command.

RE: Help needed

2003-06-24 Thread Dan Muey
> From: "Shishir K. Singh" <[EMAIL PROTECTED]> > > I have to get the size and last modified date of a remote file via > > URL without reading in the whole file. I have gone through > > LWP::UserAgent but couldn't make much headway. Any > pointers on how to > > do it would be appreciated. >

Use Carp in package

2003-06-24 Thread Dan Muey
Howdy List! I'm writing a simple module to return a few variables and functions. The perldoc perlmod* stuff says I should use Carp; and call that instead of warn(). So.. 1) If I use Carp shoud I still use warnings; in the package? 2) If I understand it correctly the preffered way would be to do:

CGI remote_user versus user_name

2003-06-24 Thread Dan Muey
CGI's remote_user() rturns $ENV{'REMOTE_USER'}; While sub user_name { my ($self) = self_or_CGI(@_); return $self->http('from') || $ENV{'REMOTE_IDENT'} || $ENV{'REMOTE_USER'}; } SO if I'm trying to get the login name I should use user_name since it will return REMOTE_USER or REMOTE_IDENT

duh RE: help sending hex EOL chars

2003-06-24 Thread McMahon, Christopher x66156
Answering my own question: my $eol = "\r\n"; \r\n becomes 0D0A. -C -Original Message- From: McMahon, Christopher x66156 Sent: Tuesday, June 24, 2003 10:35 AM To: '[EMAIL PROTECTED]' Subject: help sending hex EOL chars Hi... My TCP/IP server is printing input fine, now

Re: Use Carp in package

2003-06-24 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > I'm writing a simple module to return a few variables and functions. > > The perldoc perlmod* stuff says I should use Carp; and call that > instead of warn(). So.. 1) If I use Carp shoud I still use warnings; > in the package? Definitely. "use Carp" and "us

Re: Hi

2003-06-24 Thread John W. Krahn
Gayatri wrote: > > Thanks I got a solution. Please reply in the original thread that you started. > I was doing a silly mistake. > chdir I was executing thro' system command like cd. When you do that system creates a new process and any changes you make in that process do not affect your curren

Re: Use Carp in package

2003-06-24 Thread Tassilo von Parseval
On Tue, Jun 24, 2003 at 01:52:20PM -0500 Dan Muey wrote: > I'm writing a simple module to return a few variables and functions. > > The perldoc perlmod* stuff says I should use Carp; and call that > instead of warn(). > So.. > 1) > If I use Carp shoud I still use warnings; in the package? Those

Re: duh RE: help sending hex EOL chars

2003-06-24 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Christopher X66156 McMahon wrote: [top post moved down] >> -Original Message- >> From: McMahon, Christopher x66156 >> Sent: Tuesday, June 24, 2003 10:35 AM >> To: '[EMAIL PROTECTED]' >> Subject: help sending hex EOL chars >> >> >> Hi... >> My TCP/IP s

RE: Use Carp in package

2003-06-24 Thread Dan Muey
Excellent, Thanks Jenda and Tassilo Yeah I did mean qw() instead of () oops. Thanks for the info, I think I will just use Carp; and take your wisdom and apply it's functions appropriately Thanks again! What a great list!!! Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: Binary file conversion

2003-06-24 Thread John W. Krahn
Ned Cunningham wrote: > > HI all. Hello, > I have what appears to be a C++ file set (i.e. phone.dat, phone.idx). That looks like a database file set. The file command should tell you what they are: $ file phone.dat phone.idx > My question is can Perl read these files and what modules do I ne

RE: CGI remote_user versus user_name

2003-06-24 Thread Dan Muey
> CGI's remote_user() > rturns $ENV{'REMOTE_USER'}; > While > sub user_name { > my ($self) = self_or_CGI(@_); > return $self->http('from') || $ENV{'REMOTE_IDENT'} || > $ENV{'REMOTE_USER'}; } > > SO if I'm trying to get the login name I should use user_name > since it will return REMOTE_

Re: multi-line matches / named.conf parsing

2003-06-24 Thread Jeff 'japhy' Pinyan
On Jun 24, Kevin Pfeiffer said: >>> sed '/zone "domain.com" {/,/};/d' /etc/named.conf > newfile >>> >>> How might one do this in Perl? >> >> perl -ne 'print unless /zone "domain.com" {/ .. /};/' \ >> /etc/named.conf > newfile > >Cool, I didn't think of Perl's range operator "..". Don't be foo

Last Post today I swear - use in package

2003-06-24 Thread Dan Muey
Suppose I have a module: package MyConfig; use strict; use warnings; use CGI qw(:standard); # or user_name or one then other if fail? use DBI; use base 'Exporter'; use Carp; Now in the script I have #!/usr/bin/perl use MyConfig; .. Will use strict and warnings still be in effect for t

Re: Last Post today I swear - use in package

2003-06-24 Thread Jenda Krynicky
From: "Dan Muey" <[EMAIL PROTECTED]> > Suppose I have a module: > > package MyConfig; > > use strict; > use warnings; > > use CGI qw(:standard); # or user_name or one then other if fail? > use DBI; > > use base 'Exporter'; > use Carp; > > > Now in the script I have > > #!/usr/bin/perl >

RE: Last Post today I swear - use in package

2003-06-24 Thread Dan Muey
Cool, Thanks again Jenda, it's coming slowly, bit by bit. Have a good one! > From: "Dan Muey" <[EMAIL PROTECTED]> > > Suppose I have a module: > > > > package MyConfig; > > > > use strict; > > use warnings; > > > > use CGI qw(:standard); # or user_name or one then other if > fail? use > > DB

FW: Binary file conversion

2003-06-24 Thread Derek Byrne
Sorry John, wasn't watching where I was sending the reply... -Original Message- From: Derek Byrne Sent: 24 June 2003 21:40 To: 'John W. Krahn' Subject: RE: Binary file conversion best thing is to try opening them with notepad (if you got windows 9x/NT). dat files are usually text file

Reading from STDIN from a pipe

2003-06-24 Thread Jeff Westman
Hi, I am trying to get my script to be able to read from the command line arguments as well as take input from a pipe. This is what I have basically: #--- (begin) # #!/bin/perl use warnings; sub parseFile() { while () { # do some processing to

Re: Reading from STDIN from a pipe

2003-06-24 Thread John W. Krahn
Jeff Westman wrote: > > Hi, Hello, > I am trying to get my script to be able to read from the command line > arguments as well as take input from a pipe. This is what I have basically: > > #--- (begin) # > #!/bin/perl > use warnings; > > sub parseFile()

RE: Last Post today I swear - use in package

2003-06-24 Thread Charles K. Clarkson
On Tuesday, June 24, 2003 at 4:15 PM, Dan Muey stated: : : This is last post for me today I swear!!! But . . . On Tuesday, June 24, 2003 at 4:38 PM, Dan Muey posted: : Cool, Thanks again Jenda, it's coming slowly, : bit by bit. Just can't trust that guy! :) Charles K. Clarkson --

Re: Binary file conversion

2003-06-24 Thread Josimar Nunes de Oliveira
Hi all, May be Cobol files (data and index files) too. Josimar - Original Message - From: "Ned Cunningham" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 24, 2003 1:45 PM Subject: Binary file conversion > HI all. > > I have what appears to be a C++ file set (i.e. ph

RE: Reading from STDIN from a pipe

2003-06-24 Thread Gupta, Sharad
try doing this: sub { while ... } Look for the removed "()" around the declaration for sub, and u won't tell the sub that it takes no arguments. -Sharad -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 3:23 PM To: beginners Subject: R

RE: Reading from STDIN from a pipe

2003-06-24 Thread Gupta, Sharad
Sorry for the mistake. It should look like: sub parse { while .. } -Sharad -Original Message- From: Gupta, Sharad Sent: Tuesday, June 24, 2003 5:58 PM To: Jeff Westman; beginners Subject: RE: Reading from STDIN from a pipe try doing this: sub { while ... } Look for t

RE: basic question: handling input to TCP/IP server

2003-06-24 Thread Gupta, Sharad
I got caught by something today. So i thought it would be worth mentioning to u. Just before u do any "sysread" and "syswrite" u may also wish to check whether that socket is even available for them. Else ur call to sysread/write may just block. see "perldoc IO::Select". -Sharad -Original

Re: SSH Problem

2003-06-24 Thread Wiggins d'Anconia
Rudolf Kliemstein wrote: Hi all, i have the following problem with the following script: #!/usr/bin/perl -w # $Id: cmd.pl,v 1.4 2001/02/22 00:14:48 btrott Exp $ use strict; use Net::SSH::Perl; use Net::SSH::Perl::Cipher; chomp(my $this_host = `hostname`); print "Enter a host name to connect to:

Re: perl expect

2003-06-24 Thread Wiggins d'Anconia
Jose Malacara wrote: I have put together a script using the Perl Expect module to log into multiple hosts and execute a list of commands. I would like to be able to capture the output from each host and pattern match against it. The script (login and and issue commands) works fine, but I need some

File Handles in subroutines

2003-06-24 Thread Scott, Joshua
What do I need to do in order to use a filehandle that was opened earlier in a program within a subroutine? I've included an example of the code I have that is not doing what I would like. Basically, I never get any output to the file. If I change it so that it doesn't use the subroutine when wr

Simple doublt of $_ and print;

2003-06-24 Thread Chris San
It is supose this code prints the first line of file text.txt (which is not empty), but it doesn't print anything. $file = "text.txt"; open (file); ; print; close (file); I understood that ; gets a line (the first in this case) and, in this case, it puts the line in $_ . Also, print; (witho

RE: Simple doublt of $_ and print;

2003-06-24 Thread Tim Johnson
That's because when you read from the file handle using the <> brackets, it doesn't automatically put the line into $_. You're just throwing away the result. print() does print $_, but in this case there's nothing in it. BTW, my personal advice would be to avoid the implied $_ magick until you a

Re: Simple doublt of $_ and print;

2003-06-24 Thread Sudarshan Raghavan
Chris San wrote: It is supose this code prints the first line of file text.txt (which is not empty), but it doesn't print anything. $file = "text.txt"; open (file); ; The above statement does not store the result in $_, this is special only inside a while statement while () is equivalent t