setting expect buffer size when reading/writing to PIPE

2013-06-28 Thread Rajeev Prasad
how to set length of read buffer when expect object is a PIPE. my ($pty, $pid) = $ssh->open2pty($command); my $exp = Expect->init($pty); _now how can i set the buffer size on this object? when i print following from script, both of the following values are 0 $exp->match_max() $exp->max_accum()

Re: writing to a Spreadsheet using Spreadsheet::WriteExcel

2012-06-06 Thread Jim Gibson
On Jun 6, 2012, at 8:52 AM, Ken Furff wrote: > I have written a script for updating and modifying a price list in Excel. > First let me show you the script: > > #!/usr/bin/perl > use strict; > use Spreadsheet::XLSX; > use SpreadSheet::WriteExcel; > > my $excel = Spreadsheet::XLSX -> new ('buil

writing to a Spreadsheet using Spreadsheet::WriteExcel

2012-06-06 Thread Ken Furff
I have written a script for updating and modifying a price list in Excel. First let me show you the script: #!/usr/bin/perl use strict; use Spreadsheet::XLSX; use SpreadSheet::WriteExcel; my $excel = Spreadsheet::XLSX -> new ('build.xlsx'); my $sheet = $excel->Worksheet('Sheet1'); my ($row_min,$

Re: Perl Fork and writing to stdout

2011-10-18 Thread John W. Krahn
sunckell wrote: Hello Perl People I was wondering if someone could enlighten me on an observation I have been seeing.. A little Background info: Where I work we have been seeing very slow ssh connections times (it's not DNS. Maybe NIS, NFS, but definitely not DNS). Anyw

Re: Perl Fork and writing to stdout

2011-10-18 Thread Brandon McCaig
On Mon, Oct 17, 2011 at 2:05 PM, sunckell wrote: > So here we are back to the script.. The script works as > expected, with one item of strangeness. I was expecting the > log messages to be printed in the order they complete. For > example, if the connection attempt at 12:01 took 75 seconds to > r

Perl Fork and writing to stdout

2011-10-18 Thread sunckell
Hello Perl People I was wondering if someone could enlighten me on an observation I have been seeing.. A little Background info: Where I work we have been seeing very slow ssh connections times (it's not DNS. Maybe NIS, NFS, but definitely not DNS). Anyways I wanted to write

Re: writing to output using filehandles

2011-04-12 Thread Rob Dixon
On 12/04/2011 01:47, mark baumeister wrote: Hi I am having trouble with my search and replace code in the program below. I can sucessfully copy the input file to the output file but my search and replace is not working. Any hints on what I am doing wrong? Hello Mark. You must tell us what i

RE: writing to output using filehandles

2011-04-12 Thread Sunita Rani Pradhan
AM To: beginners@perl.org Subject: writing to output using filehandles Hi I am having trouble with my search and replace code in the program below. I can sucessfully copy the input file to the output file but my search and replace is not working. Any hints on what I am doing wrong? Thanks, M #!/

writing to output using filehandles

2011-04-12 Thread mark baumeister
Hi I am having trouble with my search and replace code in the program below. I can sucessfully copy the input file to the output file but my search and replace is not working. Any hints on what I am doing wrong? Thanks, M #!/usr/bin/perl -w use strict; my $input; my $output; my $search; my $rep

Re: No newlines when writing to a log file

2009-04-30 Thread John W. Krahn
Dave Thacker wrote: Hi folks, Hello, I've created a log file in my code, and I print various strings to it as I go through my program. The problem is that everything is showing up on one line for each iteration of my main loop, even though I have newlines in the string. I'm getting: The log

Re: No newlines when writing to a log file

2009-04-30 Thread Chas. Owens
On Thu, Apr 30, 2009 at 16:03, Dave Thacker wrote: snip > print LOG "The log starts here\n"; snip one line snip >    print "Contacting $host\n"; snip a second line snip >    my $ftp=Net::FTP->new($host,Debug=>0, Timeout=>360) or print LOG "Can't > connect to $host"; snip oops, no newline sn

No newlines when writing to a log file

2009-04-30 Thread Dave Thacker
Hi folks, I've created a log file in my code, and I print various strings to it as I go through my program. The problem is that everything is showing up on one line for each iteration of my main loop, even though I have newlines in the string. I'm getting: The log starts here Can't make test-send

Re: help with subroutines and reading/writing to file

2008-12-02 Thread Jim Hill
blake in <[EMAIL PROTECTED]>: > I am new to perl and attempting to write a script that will do a reverse dns > lookup on an ip [snip] Just looking that far, I don't think your script will work as you intend. Here's a ptr lookup using dig ... | dig -x 217.151.101.100 | 100.101.151.217.in-addr.ar

Re: help with subroutines and reading/writing to file

2008-12-01 Thread Telemachus
On Mon Dec 01 2008 @ 7:13, blake askew wrote: > Thanks for the help John. I have made the changes you suggested and managed > to get everything working properly. One more question though that is > completely different, how do I allow users to specify switches on the > command line in any order to

Re: help with subroutines and reading/writing to file

2008-12-01 Thread blake askew
Thanks for the help John. I have made the changes you suggested and managed to get everything working properly. One more question though that is completely different, how do I allow users to specify switches on the command line in any order to be used in my program. For example, I want the syntax t

Re: help with subroutines and reading/writing to file

2008-11-30 Thread John W. Krahn
blake askew wrote: I am new to perl and attempting to write a script that will do a reverse dns lookup on an ip, store this result into a file, then read the file in order to do a whois lookup. The whois lookup answer should also be written to a seperate file. I have the reverse dns lookup workin

help with subroutines and reading/writing to file

2008-11-30 Thread blake askew
I am new to perl and attempting to write a script that will do a reverse dns lookup on an ip, store this result into a file, then read the file in order to do a whois lookup. The whois lookup answer should also be written to a seperate file. I have the reverse dns lookup working, but when I also ca

Re: writing to a .txt file issues

2008-10-09 Thread David
Thank you, everyone who helped me. I greatly appreciate this. -David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: writing to a .txt file issues

2008-10-09 Thread Mr. Shawn H. Corey
On Thu, 2008-10-09 at 19:31 -0400, David wrote: > However, when I insert some code to write to a file it fails an odd death: > > #!/usr/bin/perl -w > use strict; use warnings; # This is preferred over the -w in the shebang line # use diagnostics; # This may replace warnings and gives a long expla

Re: writing to a .txt file issues

2008-10-09 Thread John W. Krahn
David wrote: My simple program works well in the terminal window: #!/usr/bin/perl -w use strict; my $answer; for ($a = 1; $a <= 100; $a++) { for ($b = 1; $b <= 100; $b++) { $answer = ($a-$b); print "$a - $b\t$answer\n"; } } Output: 1 - 1 0 1 - 2 -1 1

Re: writing to a .txt file issues

2008-10-09 Thread David
Try taking away the "+" in your filehandle line, so that it reads: open (WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt"); No, that didn't work. Program changed to: #!/usr/bin/perl -w use strict; my $answer; open(WRITE,">/Users/dave/Documents/Programming/Perl/081008ma

Re: writing to a .txt file issues

2008-10-09 Thread Dave Tang
Try taking away the "+" in your filehandle line, so that it reads: open (WRITE,">/Users/dave/Documents/Programming/Perl/081008mathables/add.txt"); Dave On Fri, 10 Oct 2008 09:31:02 +1000, David <[EMAIL PROTECTED]> wrote: open(WRITE,"+>/Users/dave/Documents/Programming/Perl/081008mathtables

writing to a .txt file issues

2008-10-09 Thread David
My simple program works well in the terminal window: #!/usr/bin/perl -w use strict; my $answer; for ($a = 1; $a <= 100; $a++) { for ($b = 1; $b <= 100; $b++) { $answer = ($a-$b); print "$a - $b\t$answer\n"; } } Output: 1 - 1 0 1 - 2 -1 1 - 3 -2 1 -

Re: writing to file

2007-06-23 Thread Yogesh Sawant
Vahid wrote: > Hi all, > I have the following code to sort UNIX's password file, it works fine > but can only display on stdout. How can I make it write the output to > a file? > Thanks, > > #!/bin/perl -w > # > use strict; > open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!; > open(passwdFH,

writing to file

2007-06-21 Thread Vahid
Hi all, I have the following code to sort UNIX's password file, it works fine but can only display on stdout. How can I make it write the output to a file? Thanks, #!/bin/perl -w # use strict; open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!; open(passwdFH, "passwd"); while () { print myFILE

Re: Writing to XML using XML::Writer

2006-08-10 Thread Rob Dixon
Nath, Alok (STSD) wrote: > > Robin Norwood wrote: >> >> Nath, Alok (STSD) wrote: >> >>> Hi, >>> Can anybody give me a simple code snippet which writes or >>> modifies this xml ? >>> >>> >>> >>> Tom >>> Aug 2006 >>> >>> >>> Dicken >>>

RE: Writing to XML using XML::Writer

2006-08-10 Thread Nath, Alok (STSD)
is fine. Thanx, Alok -Original Message- From: Robin Norwood [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 09, 2006 8:23 PM To: Nath, Alok (STSD) Cc: beginners@perl.org Subject: Re: Writing to XML using XML::Writer "Nath, Alok (STSD)" <[EM

Re: Writing to XML using XML::Writer

2006-08-09 Thread Robin Norwood
"Nath, Alok (STSD)" <[EMAIL PROTECTED]> writes: > Hi, > Can anybody give me a simple code snippet which writes or > modifies this xml ? > > > > Tom > Aug 2006 > > > Dicken > Aug 2006 >

Writing to XML using XML::Writer

2006-08-09 Thread Nath, Alok (STSD)
Hi, Can anybody give me a simple code snippet which writes or modifies this xml ? Tom Aug 2006 Dicken Aug 2006 I want to read and write into

Re: Question about writing to excel file

2005-05-20 Thread Alok Bhatt
ead an excel file and save > a > copy of one of the sheet as another excel file and > do > processing on it. (Adding formats..etc). Can u > please > tell me which would be the best module to handle > this. > I have searched the CPAN and there were lots of > modules related

Question about writing to excel file

2005-05-20 Thread Alok Bhatt
the CPAN and there were lots of modules related to writing to excel file. Please let me know to proceed... Thanks in advance. Alok __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn

Re: writing to CSV file

2005-03-11 Thread Marco Antonio Manzo
On Fri, 2005-03-11 at 10:25 +, SG Edwards wrote: > > Hi, > > I have a program that extracts variables from a list of flatfiles and I want > to > insert these variables into a PostreSQL database. > > I was planning on creating a CSV file with a line allocated for each file > which > can the

RE: writing to CSV file

2005-03-11 Thread Thomas Bätzler
SG Edwards <[EMAIL PROTECTED]> asked: > I have a program that extracts variables from a list of > flatfiles and I want to insert these variables into a > PostreSQL database. > > I was planning on creating a CSV file with a line allocated > for each file which can then be inserted into the datab

writing to CSV file

2005-03-11 Thread SG Edwards
Hi, I have a program that extracts variables from a list of flatfiles and I want to insert these variables into a PostreSQL database. I was planning on creating a CSV file with a line allocated for each file which can then be inserted into the database using the COPY command. Is the best way t

Re: Reading and writing to a program

2005-02-25 Thread marcos rebelo
the problem is not the My. The program prints: print 0 print 1 print 2 print 3 and stops this is the problem I was hopping to get print 0 print 1 print 2 print 3 1 2 3 thanks Marcos On Fri, 25 Feb 2005 08:26:03 -0500 (EST), Chris Devers <[EMAIL PROTECTED]> wrote: > On Fri, 25 Feb 2005, Mar

Re: Reading and writing to a program

2005-02-25 Thread Chris Devers
On Fri, 25 Feb 2005, Marcos Rebelo wrote: > My $pid = open2(my $RDRFH, my $WTRFH, "perl", "-e", "while (<>) > {print}"); Using 'use warnings' should have told you that 'My' is broken here. What messages do you get when you try to run the program? -- Chris Devers -- To unsubscribe, e-mail

Reading and writing to a program

2005-02-25 Thread Marcos Rebelo
I need to do some commands in another machine, I will try something like 'rlogin machine'. I'm not allowed to install new packages in the machine :'( To simplifey I tried to run a simple command in perl to simulate a 'more' command. use IPC::Open2; use IO::Handle '_IOLBF'; My $pid = open2(my $

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Matthias Kraatz
Octavian Rasnita wrote: Use select() function. Read perldoc -f select Teddy - Original Message - From: "Matthias Kraatz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 27, 2004 12:20 AM Subject: 're'-redirecting STDOUT back to ST

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Octavian Rasnita
Use select() function. Read perldoc -f select Teddy - Original Message - From: "Matthias Kraatz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 27, 2004 12:20 AM Subject: 're'-redirecting STDOUT back to STDOUT after writing to a

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Gunnar Hjalmarsson
Matthias Kraatz wrote: in a cgi-script I wanted to prevent an executable that I call from within the script from dumping output directly to the webpage. This worked fine with 'open(STDOUT,">something-log.txt")'. But now I want to write to the webpage again. 'open(STDOUT,">&STDOUT")' does not only l

're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Matthias Kraatz
Hi, this might be a really stupid question. But, in a cgi-script I wanted to prevent an executable that I call from within the script from dumping output directly to the webpage. This worked fine with 'open(STDOUT,">something-log.txt")'. But now I want to write to the webpage again. 'open(STD

writing to a DOC

2004-06-23 Thread John
I have store a greek text in mysql database field. Using my script i retrieve the greek text and then i store it in a file.doc. When i email the file.doc (through MIME::Lite) i can open it with the Microsoft Word and then it asks me the encoding of the document. I click on simple text and i can

Re: trouble with writing to file

2004-03-03 Thread Jan Eden
incognito wrote: >Thank you for your attention, Bob. > >>What is your actual regex? At a minimum, you'll need /g modifier. >>You may need /m and/or /s as well. > >May be I didn't explained my prob exactly. I don't have a problem >with the regex (and yes, I have the /m /g and /s). Related to the >

Re: trouble with writing to file

2004-03-01 Thread david
Wc -Sx- Jones wrote: [snip] > > my $file = "20040301-www.tgz"; > [snip] > > But I have a question - > > Does even mentioning (?:) usage break capturing? > > I get undefined errors when trying: > > $file =~ /^(\d+)-www.t(?:ar.)gz/i; > print $1; no. it won't break capturing. you get undef

Re: trouble with writing to file

2004-03-01 Thread WC -Sx- Jones
Owen wrote: On Mon, 1 Mar 2004 18:08:08 +0100 incognito <[EMAIL PROTECTED]> wrote: open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; while ($input =~ m/.../) { print $1; FH->print("$1\n") or die "could not write to $pkg_filename"; } I would have thought that to g

Re: trouble with writing to file

2004-03-01 Thread incognito
Thank you Bob and Owen. [Bob] > I notice you don't put an explicit path on the filename. Is it possible the > current directory is something other that what you expect it to be, and the > file is being successfully created in another location? I thought about that and so I tried an absolute path

Re: trouble with writing to file

2004-03-01 Thread Owen
On Mon, 1 Mar 2004 18:08:08 +0100 incognito <[EMAIL PROTECTED]> wrote: > open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; > while ($input =~ m/.../) { > print $1; > FH->print("$1\n") or die "could not write to $pkg_filename"; > } I would have thought that to ge

RE: trouble with writing to file

2004-03-01 Thread Bob Showalter
incognito wrote: > Thank you for your attention, Bob. > > > What is your actual regex? At a minimum, you'll need /g modifier. > > You may need /m and/or /s as well. > > May be I didn't explained my prob exactly. > I don't have a problem with the regex (and yes, I have the /m /g and > /s). Related

Re: trouble with writing to file

2004-03-01 Thread incognito
Thank you for your attention, Bob. > What is your actual regex? At a minimum, you'll need /g modifier. You may > need /m and/or /s as well. May be I didn't explained my prob exactly. I don't have a problem with the regex (and yes, I have the /m /g and /s). Related to the regex, my script works fi

RE: trouble with writing to file

2004-03-01 Thread Bob Showalter
Reinhard Mantey wrote: > undef $/; > my $input = <>; > my $pkg_filename = "longnames.txt"; > > open(FH, "> $pkg_filename") or die "could not create $pkg_filename"; > while ($input =~ m/.../) { What is your actual regex? At a minimum, you'll need /g modifier. You may need /m and/or /s as well.

trouble with writing to file

2004-03-01 Thread Reinhard Mantey
Hello, I came to perl by J.Friedl's regex-book without any perl-experiences. I wrote a little script to scan packages and their dependencies from a book (lfs). The script works fine and I get the packages with their dependencies. Now I tried to expand that script that way, that I wanted to write

trouble with writing to file

2004-03-01 Thread incognito
Hello, I came to perl by J.Friedl's regex-book without any perl-experiences. I wrote a little script to scan packages and their dependencies from a book (lfs). The script works fine and I get the packages with their dependencies. Now I tried to expand that script that way, that I wanted to write

Re: Writing to file

2004-02-01 Thread R. Joseph Newton
Support wrote: > Hi all > I have a little bit of code you may be able to help with. > I load a file into an array with > > foreach $lines(@database_array) { >@edit_array = split(/\:/,$lines); >push(@member_array,[EMAIL PROTECTED]); >$x++; > } #loop > > and then play around with the a

Re: Writing to file

2004-02-01 Thread John W. Krahn
Support wrote: > > Hi all Hello, > I have a little bit of code you may be able to help with. I load a > file into an array with > > foreach $lines(@database_array) { You should limit the scope of $lines to the foreach loop. Does $lines contain multiple lines or just one line? Perhaps you sho

Re: Writing to file

2004-02-01 Thread Jeff 'japhy' Pinyan
On Feb 2, Support said: >foreach $lines(@database_array) { > @edit_array = split(/\:/,$lines); > push(@member_array,[EMAIL PROTECTED]); > $x++; >} #loop First, it doesn't look like you're using 'strict', which means you're not declaring your variables. This is probably going to lead to trou

RE: Writing to file

2004-02-01 Thread Hanson, Rob
So you need to dereference them. I think this is what you are after. join("\:",@{$member_array[$count]}); Rob -Original Message- From: Support [mailto:[EMAIL PROTECTED] Sent: Sunday, February 01, 2004 2:31 PM To: [EMAIL PROTECTED] Subject: Writing to file Hi all I have a little bit

Writing to file

2004-02-01 Thread Support
Hi all I have a little bit of code you may be able to help with. I load a file into an array with foreach $lines(@database_array) { @edit_array = split(/\:/,$lines); push(@member_array,[EMAIL PROTECTED]); $x++; }   #loop and then pl

Re: Setting the file permissions of a file I'm writing to

2003-12-09 Thread Steve Grazzini
On Tuesday, December 9, 2003, at 10:53 PM, Dan Anderson wrote: Is it possible to specify the permissions of a file I create when I: open ("FOO", "> ./bar") or die ("Could not create file"); use Fcntl; sysopen(FOO, $path, O_WRONLY|O_CREAT|O_TRUNC, 0750) or die "sysopen: $path: $!"; -- Ste

Setting the file permissions of a file I'm writing to

2003-12-09 Thread Dan Anderson
Is it possible to specify the permissions of a file I create when I: open ("FOO", "> ./bar") or die ("Could not create file"); Thanks in advance, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Writing to $?

2003-10-22 Thread Gary Stainburn
On Wednesday 22 Oct 2003 4:41 pm, Jason wrote: > Hi All, > > I need to write a script that cooperates with a bunch of other scripts > in the 'toolbox' paradigm which is often thought of as a core tenet of > UNIX philosophy. In particular, when my script fails, the other > scripts will look in $? a

Re: Writing to $?

2003-10-22 Thread Matthew Harrison
you can use the exit function like so: #!/usr/bin/perl -wT blah..; if (it worked){ exit(0); } else { exit(100); } On Wed, Oct 22, 2003 at 10:41:15AM -0500, Jason wrote: > Hi All, > > I need to write a script that cooperates with a bunch of other scripts > in the 'toolbo

Writing to $?

2003-10-22 Thread Jason
Hi All, I need to write a script that cooperates with a bunch of other scripts in the 'toolbox' paradigm which is often thought of as a core tenet of UNIX philosophy. In particular, when my script fails, the other scripts will look in $? and based on the number therein they will perform some

Re: Reading writing to INI files

2003-08-25 Thread Jenda Krynicky
From: Saadat Saeed <[EMAIL PROTECTED]> > Are there any modules available that can read/write to > INI files. I think that apart from XML and templates there is no other task for that you'd get more modules thant reading and writing INI files. Config::IniFiles Config::IniHash Config::Tiny AnyData

RE: Reading writing to INI files

2003-08-24 Thread Phillips, Wesley
Saadat, Try Win32::Tie::Ini Wes -Original Message- From: Saadat Saeed [mailto:[EMAIL PROTECTED] Sent: Sunday, August 24, 2003 10:57 AM To: [EMAIL PROTECTED] Subject: Reading writing to INI files Hello, Are there any modules available that can read/write to INI files

Reading writing to INI files

2003-08-24 Thread Saadat Saeed
Hello, Are there any modules available that can read/write to INI files. Thanks in advance Saadat Saeed __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: Re: modifing and writing to a file (solved)

2003-07-24 Thread Ged
print "e.g. program.pl \n"; } Hopefully it may be of some use to somebody else starting out and stumbling in this area. > > From: Ged <[EMAIL PROTECTED]> > Date: 2003/07/24 Thu AM 08:47:23 GMT > To: [EMAIL PROTECTED] > Subject: Re: Re: modifing and

Re: Re: modifing and writing to a file

2003-07-24 Thread Ged
AIL PROTECTED] > Subject: Re: modifing and writing to a file > > NYIMI Jose (BMB) wrote: > > >s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g; > > > > Character classes are only possible in the matching part of the regex, > not in the replacement part. You regex says substit

Re: modifing and writing to a file

2003-07-24 Thread Sudarshan Raghavan
NYIMI Jose (BMB) wrote: s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g; Character classes are only possible in the matching part of the regex, not in the replacement part. You regex says substitute all occurences of a lowercase alphabet with the string '[A-Z]' -- To unsubscribe, e-mail: [EMAIL PROTEC

RE: modifing and writing to a file

2003-07-24 Thread NYIMI Jose (BMB)
pping on initial letters. See "ucfirst" for that.) If EXPR is omitted, uses "$_". C:\> -Original Message- From: Ged [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 10:00 AM To: [EMAIL PROTECTED] Subject: modifing and writing to a file Hi all,

Re: modifing and writing to a file

2003-07-24 Thread Janek Schleicher
Ged wrote at Thu, 24 Jul 2003 08:00:04 +: > I am very new to perl (2 days) but am finding it very rewarding. I have however > stumbled across a problem hopefully somebody can help me with. > > I am trying to open a file, change the text from lowercase to uppercase and rewrite > it to a back

RE: modifing and writing to a file

2003-07-24 Thread Marcos . Rebelo
if you are new to perl try perl -e "print uc($_) while (<>);" c:/ged/perl files/stuff.txt > c:/ged/perl files/stuff.bk -Original Message- From: Ged [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 10:00 AM To: [EMAIL PROTECTED] Subject: modifing and writing to

modifing and writing to a file

2003-07-24 Thread Ged
Hi all, I am very new to perl (2 days) but am finding it very rewarding. I have however stumbled across a problem hopefully somebody can help me with. I am trying to open a file, change the text from lowercase to uppercase and rewrite it to a backup file. However, I only seem to be duplicating

Re: writing to file

2003-07-22 Thread denis
I stand corrected.. It should be ">" not ">>".. Should stop reading the list late at night.. Thanks On Tue, 22 Jul 2003 [EMAIL PROTECTED] wrote: > > On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote: > > > open the file with ">>

Re: writing to file

2003-07-22 Thread wiggins
On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote: > open the file with ">>" > This will cause an overwrite.. > Actually that is an "append". Maybe there is a definition issue, aka I would think of an "overwrite" to be a ">" where

Re: writing to file

2003-07-21 Thread denis
open the file with ">>" This will cause an overwrite.. On Mon, 21 Jul 2003, awarsd wrote: > Hi, > > I'm curious to know if it is possible to write to file with overwritting > information without putting into an array > if i have in a file > a > b > c > d > e > and i want to add g-r-t-u-x i wou

RE: writing to file

2003-07-21 Thread Charles K. Clarkson
awarsd <[EMAIL PROTECTED]> wrote: : : I'm curious to know if it is possible to write : to file with overwritting information without : putting into an array if i have in a file : : a : b : c : d : e : and i want to add g-r-t-u-x i would get : now in the file : : g : r : t : u : x : e <-- stays the

writing to file

2003-07-21 Thread awarsd
Hi, I'm curious to know if it is possible to write to file with overwritting information without putting into an array if i have in a file a b c d e and i want to add g-r-t-u-x i would get now in the file g r t u x e <-- stays the same no overwrite. any help is appreciated Anthony -- To unsu

writing to a log file with time

2003-06-03 Thread Vema, Venkata
HI The following pl pgm executes when the process "srvtst26.pl "is stopped. It gets started automatically started thru crontab by command "ahdxapi.init" what i want now is i want to write to a log file with time when it gets started "ahdxapi.init" can any one help me on this apprecitated ur ear

Re: Writing to data files with IIS

2003-02-19 Thread R. Joseph Newton
dan wrote: > I'm writing an administration script for a website, it reads files fine, > however when it comes to open files for writing, I get the "Permission > denied" error message. I'm not exactly sure what's wrong with this. Is this > a configuration problem at IIS's end, or do I need to do so

Writing to data files with IIS

2003-02-19 Thread dan
I'm writing an administration script for a website, it reads files fine, however when it comes to open files for writing, I get the "Permission denied" error message. I'm not exactly sure what's wrong with this. Is this a configuration problem at IIS's end, or do I need to do soemthing special with

Re: Weird problem with writing to PostgreSQL through DBI

2003-01-29 Thread Ben Siders
1a0' it works jsut fine. The field is just text. Why does one random string work and another fail? -------- Subject: Weird problem with writing to PostgreSQL through DBI From: Ben Siders <[EMAIL PROTECTED]> Date: Wed, 29 Jan 2003 14:35:30 -0600 To: [EMAIL PROTEC

Weird problem with writing to PostgreSQL through DBI

2003-01-29 Thread Ben Siders
I am parsing some XML and trying to write the tags to a table. Here is the table (PostgreSQL): Column | Type | Modifiers ---+-+--- id| integer | ref_id| text| ref_table | text| tag | text| seq | integer | Here is the code where I

RE: writing to log from perl script

2002-11-06 Thread wiggins
Check out: Sys::Syslog (standard module) for simple stuff, or for the ultimate control you might check out the following: http://log4perl.sourceforge.net/ http://danconia.org On Wed, 6 Nov 2002 00:42:10 +0100, K Pfeiffer <[EMAIL PROTECTED]> wrot

writing to log from perl script

2002-11-06 Thread K Pfeiffer
Hi, I was reading up today on syslog and it gave the following shell script example of how to set up a logging service: $ logger -p local5.info "Script terminated normally" I was wondering what the best way might be to do this from a perl script that runs periodically - have it append directly

Re: Open/Writing To A File Question

2002-10-08 Thread Jenda Krynicky
s! Something like this should work: system ("start $filename"); or system ("wordpad $filename"); > (If this works, is it possible to show it writing to file? For > example, when you ping a machine, you see each ping one at a time. Can > I do this to my op

Open/Writing To A File Question

2002-10-08 Thread Anthony Beaman
ble to direct it to a file but it's not launching the file for view. In other words, my goal is to enter the .pl file in DOS but have a file (wordpad) open up and show the results. Any ideas? Thanks! (If this works, is it possible to show it writing to file? For example, when you ping a

Re: Opening and Writing to Files

2002-07-18 Thread John W. Krahn
Carrie Lyn Brammer wrote: > > I've looked throgh the recent archives. A lot of what > is being discussed seems too 'advanced' for me. I guess > i'm a REAL baby newbie. > > Can someone please look at the following project, and > tell me why it is not writing the contents of the > readfile.txt to

Re: Opening and Writing to Files

2002-07-18 Thread Mat Harris
you need to add the name of the target filehandle when you write to it. for example: if you open writefile.txt with the filehandle WRITE, you must print to it like so: print WRITE "add some text"; At 18:18 18/07/2002 -0500, Carrie Lyn Brammer wrote: >I've looked throgh the recent archives. A

Re: Opening and Writing to Files

2002-07-18 Thread Connie Chan
>> print (@contents); You have to print to the file handle, otherwise, nothing will write to WRITEFILE, but to screen only. So, you have to write as : print WRITEFILE @contents; >> @newcontents = ; >> print "\n The contents of writefile.txt is $newcontents \n"; No, $newcontents here will prin

Opening and Writing to Files

2002-07-18 Thread Carrie Lyn Brammer
I've looked throgh the recent archives. A lot of what is being discussed seems too 'advanced' for me. I guess i'm a REAL baby newbie. Can someone please look at the following project, and tell me why it is not writing the contents of the readfile.txt to the writefile.txt? It's tough to learn

Re: Writing to an existing MS Excel file

2002-06-13 Thread Jenda Krynicky
From: "Rob" <[EMAIL PROTECTED]> > Does anyone have any advice on how to write to an EXISTING MS Excel > file? The goal is to have a script update values in an excel file. > > Thanks, > Rob use Win32::OLE; $excel = new Win32::OLE 'Excel.Application', 'quit()'; #$excel->{Visible} = 1; $excel->Ope

Re: Writing to an existing MS Excel file

2002-06-12 Thread drieux
On Wednesday, June 12, 2002, at 12:00 , Rob wrote: > Does anyone have any advice on how to write to an EXISTING MS Excel file? > The goal is to have a script update values in an excel file. I would of course start at the CPAN and look at http://search.cpan.org/search?dist=Spreadsheet-W

Re: Writing to an existing MS Excel file

2002-06-12 Thread Craig Moynes/Markham/IBM
"Rob" cc: Subject: Writing to an existing MS Excel file 06

Writing to an existing MS Excel file

2002-06-12 Thread Rob
Does anyone have any advice on how to write to an EXISTING MS Excel file? The goal is to have a script update values in an excel file. Thanks, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Win32::TieRegistry Tutorial (WAS: Writing to the Windows registry)

2002-05-22 Thread Timothy Johnson
little slack when it comes to # calling keys and values, but it is always a good idea to add a slash # to the end whenever you are working with a key. This reduces the # possibility of accidentally creating a value when you meant to create # a key, or vice versa. #[3]Here's a link to a web p

RE: Writing to the Windows registry

2002-05-20 Thread Timothy Johnson
ormation as is in the Registry remotely from one file, much less several dozen .ini files would be a nightmare over a WAN connection, but you can get/set information quickly with the Registry because it is in memory. Of course, that does mean that we should be as responsible as possible about who gets to wr

Re: Writing to the Windows registry

2002-05-19 Thread drieux
On Sunday, May 19, 2002, at 11:01 , Postman Pat wrote: [..] > I obviously did something from here coz this does not work. > --- Start code --- > print ("Inserting registry settings [@ARGV[$i]]\n"); > my $Register = "thiskey/test"; > my $hkey; > > $HKEY_CURRENT_USER->Open ($Register,$hkey)

Writing to the Windows registry

2002-05-19 Thread Postman Pat
Greetings, I am trying to write to the registry using example code that I got from le- berre.com I obviously did something from here coz this does not work. --- Start code --- print ("Inserting registry settings [@ARGV[$i]]\n"); my $Register = "thiskey/test"; my $hkey; $HKEY_CURRENT_US

Re: Question about writing to file

2002-03-28 Thread John W. Krahn
Richard Noel Fell wrote: > > Here is a subroutine that prints strings to a file. I want the routine > to write strings to the file in the format > Question1:factor(x^2+4*x+3)=(x+3)*(x+1). > However, what is written to file is > Question1:factor(x^2+4*x+3) > =(x+3)*(x+1), that is, > a newline befo

Re: Question about writing to file

2002-03-28 Thread Hans Holtan
Try removing the newline at the end of your question with a call to chomp. else{ for (my $i=1; $i<=$#qk+1;$i++){ chomp ($Question_hash{$qk[$i-1]}); print In1 "Question"."$i".":factor$Question_hash{$qk[$i-1]}=$Answer_hash{$ak[$i-1]}\n"; } >Here is a subroutine that prints strings to a file.

  1   2   >