Re: new line using print

2010-10-14 Thread Shawn H Corey
On 10-10-13 04:16 PM, Amish Rughoonundon wrote: Hi, I would like to print a file under windows using perl but with the end of line character be only 0x0A and not 0x0D followed by 0x0A. Is there a way to set $\ to 0x0A so that every time I use print, it only prints 0x0A and NOT 0x0D followed by

new line using print

2010-10-14 Thread Amish Rughoonundon
Hi, I would like to print a file under windows using perl but with the end of line character be only 0x0A and not 0x0D followed by 0x0A. Is there a way to set $\ to 0x0A so that every time I use print, it only prints 0x0A and NOT 0x0D followed by 0x0A. Any other method would also be welcomed. Than

Re: Using print to overwrite a line

2003-11-25 Thread Hacksaw
This is not the most elegant solution, but it did only take me five minutes. The salient part is the backspace and printing blanks bit. A more elegent solution would figure out how to destructively clear the line using something from ncurses. #!/usr/bin/perl -w $|=1; @reports = ("starting", "

Re: Using print to overwrite a line

2003-11-25 Thread Rob Dixon
Paul Harwood wrote: > > Is there a simple way to print over an existing line? > > For example: I would like to have a progress report that reads 10%, 20% > etc. I don't want to print a new line each time. I want to write over > the existing line and have it update as it goes. Hi Paul. I presume y

RE: Using print to overwrite a line

2003-11-25 Thread Bob Showalter
Paul Harwood wrote: > Is there a simple way to print over an existing line? > > For example: I would like to have a progress report that > reads 10%, 20% > etc. I don't want to print a new line each time. I want to write over > the existing line and have it update as it goes. > > --Paul Use "\r"

Using print to overwrite a line

2003-11-25 Thread Paul Harwood
Is there a simple way to print over an existing line? For example: I would like to have a progress report that reads 10%, 20% etc. I don't want to print a new line each time. I want to write over the existing line and have it update as it goes. --Paul

Re: Using Print -strange behavior

2003-03-24 Thread Morten Liebach
On 2003-03-24 07:27:14 -0800, Ovid wrote: > --- Jose Luis Martinez <[EMAIL PROTECTED]> wrote: > > Hello Ovid > > > > This is the code that I am trying to run > > > > #!/usr/bin/perl > > > > my $a="Hello World"; > > > > print $a; > > There is nothing wrong with this code. Thoughts: > > * what

Re: Using Print -strange behavior

2003-03-24 Thread Ovid
--- Jose Luis Martinez <[EMAIL PROTECTED]> wrote: > Hello Ovid > > This is the code that I am trying to run > > #!/usr/bin/perl > > my $a="Hello World"; > > print $a; There is nothing wrong with this code. Thoughts: * what is the result of 'which perl'? Are you pointing to the same interpre

Re: Using Print -strange behavior

2003-03-24 Thread Janek Schleicher
Jose Luis Martinez wrote at Sun, 23 Mar 2003 15:04:42 -0800: > This is the code that I am trying to run > > #!/usr/bin/perl > > my $a="Hello World"; > > print $a; Runs fine for me, allthough I wouldn't use $a as a variable. (It's already a global variable used e.g. in sortings, see perldoc pe

Re: Using Print -strange behavior

2003-03-24 Thread Jose Luis Martinez
Hello Ovid This is the code that I am trying to run #!/usr/bin/perl my $a="Hello World"; print $a; Thanks, JL "Ovid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > --- Jose Luis Martinez <[EMAIL PROTECTED]> wrote: > > Hello All > > > > I installed Linux 8.0(kernel 2.4.18-14) a

Re: Using Print -strange behavior

2003-03-22 Thread Ovid
--- Jose Luis Martinez <[EMAIL PROTECTED]> wrote: > Hello All > > I installed Linux 8.0(kernel 2.4.18-14) and Perl V5.8.0 and when I try to > run a Perl program with the line > print "Hello World" > it does not work, just perl executed it without an error. > > I checked it the script using > per

Using Print -strange behavior

2003-03-22 Thread Jose Luis Martinez
Hello All I installed Linux 8.0(kernel 2.4.18-14) and Perl V5.8.0 and when I try to run a Perl program with the line print "Hello World" it does not work, just perl executed it without an error. I checked it the script using perl -c script_name and it return OK Thanks -- To unsubscribe, e-

Re: Using print

2001-12-26 Thread Michael Fowler
On Wed, Dec 26, 2001 at 02:24:16PM -0800, Lance Prais wrote: [snip] > print (substr($line, 42, 7)); [snip] > print substr($line, 42, 7); > > but getting the following error: > > syntax error at emailagent line 16, near ");" The code snippets you've shown us would not result in that error messag

RE: Using print

2001-12-26 Thread Bob Showalter
> -Original Message- > From: Lance Prais [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 26, 2001 5:24 PM > To: [EMAIL PROTECTED] > Subject: Using print > > > I am using the following statment to try to print a sub > string of a line > bu

Using print

2001-12-26 Thread Lance Prais
I am using the following statment to try to print a sub string of a line but print (substr($line, 42, 7)); or print substr($line, 42, 7); but getting the following error: syntax error at emailagent line 16, near ");" Can anyone tell me what I am doing wrong? Thank you Lance -- To unsubs

Re: using print << within subroutines

2001-06-04 Thread Paul
--- Me <[EMAIL PROTECTED]> wrote: > > sub header { > > print << head; > > Content-type: text/html\n\n > > > > Control Panel > > > > head > > } > > As dumb as this sounds, you can't have the 'head' > at the end indented. Well, not without some extra > stuff. As a simple

Re: using print << within subroutines

2001-06-03 Thread Christian Campbell
[EMAIL PROTECTED] wrote: > within my code. it works like a charm. however, when i try: > > sub header { > print << head; > Content-type: text/html\n\n > > Control Panel > > head > } > > is this not working because of a fault in my syntax? or is this not > possible withi

Re: using print << within subroutines

2001-06-03 Thread Me
> sub header { > print << head; > Content-type: text/html\n\n > > Control Panel > > head > } As dumb as this sounds, you can't have the 'head' at the end indented. Well, not without some extra stuff. If you run perldoc perldata You'll find: If you want you

Re: using print << within subroutines

2001-06-03 Thread Eric Beaudoin
At 16:42 2001.06.03, you wrote: >hello all- >quick question that is definitely from a neophyte. > >i am currently using: > >sub begin { > print "Content-type: text/html\n\n"; > print "\n"; > print "Control Panel\n"; > print "\n"; >} > >sub footer { >print "\n"; >print "\n"; >} > > >wit

using print << within subroutines

2001-06-03 Thread charles
hello all- quick question that is definitely from a neophyte. i am currently using: sub begin { print "Content-type: text/html\n\n"; print "\n"; print "Control Panel\n"; print "\n"; } sub footer { print "\n"; print "\n"; } within my code. it works like a charm. however, when i