[25020] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7270 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 19 18:07:09 2004

Date: Tue, 19 Oct 2004 15:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 19 Oct 2004     Volume: 10 Number: 7270

Today's topics:
        Any suggestions? <davidw_spam@spam_gto.net>
    Re: Any suggestions? <jgibson@mail.arc.nasa.gov>
    Re: Any suggestions? <Jon.Ericson@jpl.nasa.gov>
    Re: Any suggestions? <tadmc@augustmail.com>
    Re: Audio DSP Perl Module <usenet@morrow.me.uk>
    Re: Calling a perl script from an html doc <spam@spamhotmail.com>
    Re: Calling a perl script from an html doc <ebohlman@omsdev.com>
    Re: Calling a perl script from an html doc <1usa@llenroc.ude.invalid>
    Re: Editable webpage code - security loopholes? <jwillmore@adelphia.net>
    Re: Fetching question (this was once answered by Luke f <1usa@llenroc.ude.invalid>
        GD::Graph - get_feature_coordinates problem <yoann.wyffels@iloahosting.com>
    Re: GD::Graph - get_feature_coordinates problem (Anno Siegel)
    Re: GD::Graph - get_feature_coordinates problem <yoann.wyffels@iloahosting.com>
    Re: GD::Graph - get_feature_coordinates problem (Anno Siegel)
    Re: How do I print http 404 not found header? <gregs@trawna.com>
        How do I use " and \n in @ARGV[1]? <nntp@rogers.com>
    Re: How do I use " and \n in @ARGV[1]? (Anno Siegel)
    Re: How do I use " and \n in @ARGV[1]? <nntp@rogers.com>
    Re: How do I use " and \n in @ARGV[1]? <phaylon@dunkelheit.at>
    Re: How do I use " and \n in @ARGV[1]? <tadmc@augustmail.com>
    Re: How do I use " and \n in @ARGV[1]? <spamtrap@dot-app.org>
    Re: How do I use " and \n in @ARGV[1]? <bik.mido@tiscalinet.it>
    Re: How do I use " and \n in @ARGV[1]? <bik.mido@tiscalinet.it>
    Re: How do I use " and \n in @ARGV[1]? <tadmc@augustmail.com>
    Re: How do I use " and \n in @ARGV[1]? <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 19 Oct 2004 14:47:44 -0400
From: David Warren <davidw_spam@spam_gto.net>
Subject: Any suggestions?
Message-Id: <weCdnYecxoKj_ejcRVn-gw@golden.net>

Hi,

Okay, I was wondering if anybody has any better ideas on how to 
implement this....
This is for updating a progress bar.  (As far as I've tried this is 
working) I'm taking the output from:

"
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
input:  13 - Mrs. Robinson.mp3  (44.1 kHz, 2 channels, MPEG-1 Layer III)
output: 13 - Mrs. Robinson.mp3.wav  (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
Frame#  8575/8575   192 kbps  L  R
"

The only line I really care about is the last line with Frame#.
By the way, this is my first program I'm writing with perl, only have a 
little background in shell scripting.  Just don't know if this is the 
most efficient way of doing this.

<code>

my ( @nums , $num );
local $/ = "\r";
open PIPE, "lame $args \"$song_source\"  \"$song_destin\" 2>&1 |";
my $y = $e->gauge_start( text => "Converting: $song_source", percentage 
=> 1 );
my $line_count = 1;

then I'm using a while loop:

while ( <PIPE> ) {
	if ( /Frame/ && /kbps/ && /$line_count/ ) {
		$line_count++;
		unless ( defined($num) ) {
			@nums = m/(\/\d+\.?\d*|\.\d+)/g;
			$num = "@nums";
			$num =~ s/\///;
		}
		else {
			$y = $e->gauge_set( $line_count/$num * 100 );
			chomp($y);
		}
</code - snip >
(this should all be that is relevant (yes the code could probably be 
cleaned up ... ;-)

I'm not too certain about the @nums = m/(\/\d+\.?\d*|\.\d+)/g .
That is extracting the latter half of the numbers in:  8575/8575
Any suggestions?  I'm just doing this too familiarize myself with perl.

Thanks a lot for the help.
David


------------------------------

Date: Tue, 19 Oct 2004 12:56:42 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Any suggestions?
Message-Id: <191020041256423006%jgibson@mail.arc.nasa.gov>

In article <weCdnYecxoKj_ejcRVn-gw@golden.net>, David Warren
<davidw_spam@spam_gto.net> wrote:


> Frame#  8575/8575   192 kbps  L  R
> "
> 
> The only line I really care about is the last line with Frame#.
> By the way, this is my first program I'm writing with perl, only have a 
> little background in shell scripting.  Just don't know if this is the 
> most efficient way of doing this.
> 
> <code>
> 

I am assuming you have 'use strict' and 'use warnings' at the beginning
of your program.

> my ( @nums , $num );
> local $/ = "\r";
> open PIPE, "lame $args \"$song_source\"  \"$song_destin\" 2>&1 |";
> my $y = $e->gauge_start( text => "Converting: $song_source", percentage 
> => 1 );
> my $line_count = 1;
> 
> then I'm using a while loop:
> 
> while ( <PIPE> ) {
>  if ( /Frame/ && /kbps/ && /$line_count/ ) {

Here you are trying to match the input line against the current value
of $line_count. Why are you doing that? The line you show above doesn't
have a line count value in it. This test will succeed randomly based on
whether or not the actual line has the current value of $line_count in
it as a substring somewhere.

You can test and extract the number you want from the input line in one
operation:

   if( |Frame#\s*\d+/(\d+)| ) {
      my $num = $1;
      # do something with $num
   }

>     $line_count++;
>     unless ( defined($num) ) {

Why are you testing to see if $num is defined? This will result in only
performing the extraction one time, since you are assigning a value to
$num below.

>        @nums = m/(\/\d+\.?\d*|\.\d+)/g;

Why are you testing your numbers for decimal points? Your example
doesn't have them. If they could have decimal points, use a character
class for matching numbers: [\d.]+

>        $num = "@nums";

This assigns a string to $num consisting of the elements of @nums
separated by spaces. That is probably not what you want to do, More
likely you want some member of @nums: $num = $nums[0] or $num =
$nums[1];

>        $num =~ s/\///;
>     }
>     else {
>        $y = $e->gauge_set( $line_count/$num * 100 );
>        chomp($y);
>     }
> </code - snip >
> (this should all be that is relevant (yes the code could probably be 
> cleaned up ... ;-)

Then you should clean it up before asking hundreds of people for help.
If you need more help, please post a complete, working, minimal program
that shows the problem you are having.

Thanks.


------------------------------

Date: Tue, 19 Oct 2004 13:42:22 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: Any suggestions?
Message-Id: <rcghdoqcudt.fsf@Jon-Ericson.sdsio.prv>

David Warren <davidw_spam@spam_gto.net> writes:

> Subject: Any suggestions?

Maybe a more descriptive subject?  :-)

> my ( @nums , $num );
> local $/ = "\r";

Do you really need this?  Normally the default setting of $/ is just
fine.

> open PIPE, "lame $args \"$song_source\"  \"$song_destin\" 2>&1 |";

You could make this a tad easier to read with:

  open PIPE, qq{lame $args "$song_source" "$song_destin" 2>&1 |};

I don't have lame (some sort of MP3 decoder?) installed on my system,
so I can't guess what sort of output it might have beyond the example
you gave.

> my $y = $e->gauge_start( text => "Converting: $song_source",
> percentage => 1 );
> my $line_count = 1;

See perlvar for the $. variable.  (Oops.  I read down and you are only
counting the number of lines that include /Frame/ and /kbps/ and the
current value of $line_count.  $. doesn't help in this case.  Is
$frame_count a better name?)

> then I'm using a while loop:
>
> while ( <PIPE> ) {
> 	if ( /Frame/ && /kbps/ && /$line_count/ ) {

Do you really want to look for the current value of $line_count here?
It seems odd if you do.  It might be more clear if you combine this
into one regex.  Maybe like:

        if ( /^Frame.*kbps/ ) {

But I don't know where the $line_count should be.

> 		$line_count++;
> 		unless ( defined($num) ) {
> 			@nums = m/(\/\d+\.?\d*|\.\d+)/g;

This is the bit of code you had a question about.  It finds all of the
strings that match a '/' followed by a number (with optional decimal
portion) or just the decimal portion of a number.  It puts those
strings into the @num array.  In the example input you gave there's
just one element.

> 			$num = "@nums";

This converts the array into a string with spaces separating the array
elements.  In the example, $num is "/8575".

> 			$num =~ s/\///;

And this removes the '/' from $num.

I don't know the variety of input you expect, but it looks like you
expect to get just one number out of this.  If so, the above block
might be better written something like this:

                        if (m{/(\d+\.?\d*|\.\d+)}){
                            $num = $1;
                        }

This isn't exactly equivalent, obviously.  You'd have to test with a
bigger set of input.  While you are at it, it's possible you could
combine this with the regex I suggested above:

        if ( m{^Frame.*/(\d+\.?\d*|\.\d+).*kbps} ) {

> 		}
> 		else {
> 			$y = $e->gauge_set( $line_count/$num * 100 );
> 			chomp($y);
> 		}

> (this should all be that is relevant (yes the code could probably be
> cleaned up ... ;-)

Not exactly.  I don't know what the gauge_start method is or what
class it belongs to, for instance.  Creating a small, self-contained
example is often useful for having other people comment.  It also
helps you understand what's going on.  Also including a variety of
input and what output you expect, can help.

(Did I mention that it's hard to test my suggestions because I don't
know what sort of input is possible? ;-)

Jon


------------------------------

Date: Tue, 19 Oct 2004 16:54:01 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Any suggestions?
Message-Id: <slrncnb37p.1s4.tadmc@magna.augustmail.com>

David Warren <davidw_spam@spam_gto.net> wrote:


> Subject: Any suggestions?


Yes, I suggest putting the subject of your article in the 
Subject of your article. That is what it is there for!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 18 Oct 2004 17:33:59 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Audio DSP Perl Module
Message-Id: <ns7d42-kg5.ln1@osiris.mauzo.dyndns.org>


Quoth hemalatha@lantana.tenet.res.in (Hemalatha N):
> 
> I am using Audio::DSP, a PERL

Perl

> module for reading the sound card
> directly in Linux.  But, when I try to install it on a machine with an
> inbuilt sound card, it doesn't saying "unable to set format". 
> Actually, the inbuilt sound cards have the capacity to record only in
> a particular sampling frequency.

Then find out what that is and tell Audio::DSP to use it. Or install a
real soundcard and use that instead. Or install ALSA and fork out to
arecord :).

Ben

-- 
If I were a butterfly I'd live for a day, / I would be free, just blowing away.
This cruel country has driven me down / Teased me and lied, teased me and lied.
I've only sad stories to tell to this town: / My dreams have withered and died.
  ben@morrow.me.uk                                                 (Kate Rusby)


------------------------------

Date: Tue, 19 Oct 2004 09:07:11 -0600
From: "Spin" <spam@spamhotmail.com>
Subject: Re: Calling a perl script from an html doc
Message-Id: <10naba0m8jlt2b7@corp.supernews.com>

> > There is no web server. There is a file server (samba) on which the
> > html doc is located. The file server has perl installed, but no web
> > server. And installing a web server is not an option.
>
> Why, specifically, is it not an option?

The solution is for a specific accounting system with a small user base (a
few hundred installations). There is a diverse set of server/client setups
in these installations, and I don't want to introduce any more third-party
software (eg. Apache webserver) than I have to. I figure that most already
have perl or would be willing to install it.

Thanks for your help
Caleb




------------------------------

Date: 19 Oct 2004 18:10:57 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Calling a perl script from an html doc
Message-Id: <Xns9587871028D7Cebohlmanomsdevcom@130.133.1.4>

"Spin" <spam@spamhotmail.com> wrote in
news:10naba0m8jlt2b7@corp.supernews.com: 

>> > There is no web server. There is a file server (samba) on which the
>> > html doc is located. The file server has perl installed, but no web
>> > server. And installing a web server is not an option.
>>
>> Why, specifically, is it not an option?
> 
> The solution is for a specific accounting system with a small user
> base (a few hundred installations). There is a diverse set of
> server/client setups in these installations, and I don't want to
> introduce any more third-party software (eg. Apache webserver) than I
> have to. I figure that most already have perl or would be willing to
> install it. 

Ah, that's a good reason rather than a superstitious one.  In that case, 
one possibility (assuming that "have perl or would be willing to install 
it" applies to the server machines as well as the client machines) would be 
to write, in Perl, a special-purpose "mini-server" program that would run 
on the server machines.  This could be done using HTTP::Daemon or the like; 
a good example is Sean Burke's nifty little Pod::Webserver which creates a 
local "server" (listening on port 8020 by default) that takes HTTP requests 
for Perl documentation and serves up HTML-formatted versions of any of your 
PODs.  It works nicely on my Win98 machine, so the underlying HTTP::Daemon 
implementation shouldn't be too technology-dependent.


------------------------------

Date: 19 Oct 2004 20:40:28 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Calling a perl script from an html doc
Message-Id: <Xns9587A99F0791Aasu1cornelledu@132.236.56.8>

lesley_b_linux@yahoo.co.yuk wrote in
news:m3d5zft9in.fsf@helmholtz.local: 

> "Jürgen Exner" <jurgenex@hotmail.com> writes:
> 
>> lesley_b_linux@yahoo.co.yuk wrote:

>> > Has there ever been any other
>> > language used with CGI or was CGI specifically designed to work
>> > with Perl and nothing else?
>> 
>> OHMYGOD. You are kidding, aren't you?
> 
> Now, is that really the best you can offer this newsgroup?

No, that is not the best he can offer the newsgroup (in fact Jürgen has 
given excellent help to many here), but it is probably far better than what 
you deserved for asking such a question.

Please note that I am not suggesting that you should never ponder such 
questions, but when you have a question like that, you should prefer to use 
google or some other search engine _before_ posting to a newsgroup and 
thereby asking thousands of people the answer to a question you could have 
figured out in mere seconds.

Sinan.


------------------------------

Date: Tue, 19 Oct 2004 10:44:49 -0400
From: James Willmore <jwillmore@adelphia.net>
Subject: Re: Editable webpage code - security loopholes?
Message-Id: <v_6dndIzBpbCtejcRVn-iQ@adelphia.com>

Duke of Hazard wrote:
<snip>
> It works, but what security checks do I need to perform on it? I
> realize I need to sanitize the password field, how about the textarea
> field?
<snip>

Read ...
http://www.w3.org/Security/Faq/www-security-faq.html

That's a good place to start.  It helps you to understand fully what 
you're asking and what approach would be best for you.

HTH

Jim


------------------------------

Date: 19 Oct 2004 21:05:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Fetching question (this was once answered by Luke from Hong Kong)
Message-Id: <Xns9587ADE445B50asu1cornelledu@132.236.56.8>

mnbv4567@yahoo.com (Jeff M.) wrote in news:c308860a.0410180743.584147c1
@posting.google.com:

> I'm trying to fetch a link and i dont need the content of the link i
> just need the link itself. Here is what i mean:
> Lets say when you go to: http://www.go.to/username it forwards you to:
> http://www.geocities.com/username
> 
> So how do i fetch url http://www.go.to/username to find out which url
> it forwarded me to.
> 
> Few years ago i was working with a programmer, Luke, from Hong Kong
> and he was able to figure this out for me. And now i need this again,
> Luke if you are out there please contact me.

Use the force, Luke, use the force.

Sorry, I could not resist.

Anyway, check out the documentation for the LWP module. The example given 
in perldoc LWP is good enough to get you started. That is, read the 
documentation first instead of trying to locate some guy called look. The 
equivalent of the 'using the force' in programming is reading the docs.

use strict;
use warnings;

use LWP::UserAgent;

my $ua = LWP::UserAgent->new;
$ua->agent("RedirectFinder ");

my $req = HTTP::Request->new(HEAD => 'http://some.url.invalid');
my $res = $ua->request($req);

if(my $rp = $res->previous) {
    print $rp->header('Location');
}

__END__

Sinan


------------------------------

Date: Tue, 19 Oct 2004 13:33:46 +0200
From: "Yoann Wyffels" <yoann.wyffels@iloahosting.com>
Subject: GD::Graph - get_feature_coordinates problem
Message-Id: <4174fb8d$0$27911$626a14ce@news.free.fr>

Hi,

I'm trying to use the "get_feature_coordinates" function in GD::Graph which 
is intended to return an array of value.

Documentation says:
"
$graph->get_feature_coordinates($feature_name)
Experimental: Return a coordinate specification for a certain feature in the 
chart. Currently, features that are defined are axes, the coordinates of the 
rectangle within the axes; x_label, y1_label and y2_label, the labels 
printed along the axes, with y_label provided as an alias for y1_label; and 
title which is the title text box
"

So I write this after having graph my chart:
splice @test;
 my @test=$graph->get_feature_coordinates("axes");
print "@test";

And the print command return me this: ARRAY(0x1c9d070)

How to have the real value and not a memory adress or an array pointer...?

Thx a lot,
Regards,
Yoann. 




------------------------------

Date: 19 Oct 2004 12:03:26 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: GD::Graph - get_feature_coordinates problem
Message-Id: <cl2vqe$862$2@mamenchi.zrz.TU-Berlin.DE>

Yoann Wyffels <yoann.wyffels@iloahosting.com> wrote in comp.lang.perl.misc:
> Hi,
> 
> I'm trying to use the "get_feature_coordinates" function in GD::Graph which 
> is intended to return an array of value.
> 
> Documentation says:
> "
> $graph->get_feature_coordinates($feature_name)
> Experimental: Return a coordinate specification for a certain feature in the 
> chart. Currently, features that are defined are axes, the coordinates of the 
> rectangle within the axes; x_label, y1_label and y2_label, the labels 
> printed along the axes, with y_label provided as an alias for y1_label; and 
> title which is the title text box
> "
> 
> So I write this after having graph my chart:
> splice @test;
>  my @test=$graph->get_feature_coordinates("axes");
> print "@test";
> 
> And the print command return me this: ARRAY(0x1c9d070)
> 
> How to have the real value and not a memory adress or an array pointer...?

    my @test = @{ $graph->get_feature_coordinates("axes")}; # untested

Anno


------------------------------

Date: Tue, 19 Oct 2004 15:51:29 +0200
From: "Yoann Wyffels" <yoann.wyffels@iloahosting.com>
Subject: Re: GD::Graph - get_feature_coordinates problem
Message-Id: <41751ba8$0$27901$626a14ce@news.free.fr>

>    my @test = @{ $graph->get_feature_coordinates("axes")}; # untested

It's working ! Really good idea to do directly a @ :)
Thx
Regards,
Yoann. 




------------------------------

Date: 19 Oct 2004 16:16:37 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: GD::Graph - get_feature_coordinates problem
Message-Id: <cl3el5$kkl$1@mamenchi.zrz.TU-Berlin.DE>

Yoann Wyffels <yoann.wyffels@iloahosting.com> wrote in comp.lang.perl.misc:
> >    my @test = @{ $graph->get_feature_coordinates("axes")}; # untested
> 
> It's working ! Really good idea to do directly a @ :)

It's called de-referencing.  You should probably take a look at perldsc.

Anno


------------------------------

Date: Tue, 19 Oct 2004 14:32:48 -0400
From: Greg Schmidt <gregs@trawna.com>
Subject: Re: How do I print http 404 not found header?
Message-Id: <dfrzw2hownih.dlg@trawna.com>

On Tue, 19 Oct 2004 01:26:36 GMT, Jürgen Exner wrote:

> nntp wrote:
>> print "HTTP/1.1 404 Not Found";
>> do I need
>> print "Content-type: text/html\n\n"; after it?
> 
> No, print() statements in Perl are independent of each other. The first text 
> will print just fine without the second print() command.
> Is there actually any programming language where you would have to issue a 
> second print command for the first one to print?

Hmm, maybe buffering issues due to the first text not ending with a
newline?

-- 
Greg Schmidt  gregs@trawna.com
  Trawna Publications  http://www.trawna.com/


------------------------------

Date: Tue, 19 Oct 2004 08:56:33 -0400
From: "nntp" <nntp@rogers.com>
Subject: How do I use " and \n in @ARGV[1]?
Message-Id: <lv-dnVxhCJCAkujcRVn-uA@rogers.com>

My program needs @ARGV[1] as an input string. In this input string,
sometimes I need " and new line \n. How do I do this?
Currently I am doing this:

perl perlfile.pl "somestring"


Can I do
perl perlfile.pl "somestring\"afterquote"
perl perlfile.pl "somestring\nanotherline"




------------------------------

Date: 19 Oct 2004 13:08:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <cl33ji$bnd$1@mamenchi.zrz.TU-Berlin.DE>

nntp <nntp@rogers.com> wrote in comp.lang.perl.misc:
> My program needs @ARGV[1] as an input string. In this input string,
> sometimes I need " and new line \n. How do I do this?
> Currently I am doing this:
> 
> perl perlfile.pl "somestring"
> 
> 
> Can I do
> perl perlfile.pl "somestring\"afterquote"
> perl perlfile.pl "somestring\nanotherline"

That depends on your shell, not Perl.

Anno


------------------------------

Date: Tue, 19 Oct 2004 09:10:14 -0400
From: "nntp" <nntp@rogers.com>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <1PSdnWv1Nq_Jj-jcRVn-ig@rogers.com>

> > My program needs @ARGV[1] as an input string. In this input string,
> > sometimes I need " and new line \n. How do I do this?
> > Currently I am doing this:
> >
> > perl perlfile.pl "somestring"
> >
> >
> > Can I do
> > perl perlfile.pl "somestring\"afterquote"
> > perl perlfile.pl "somestring\nanotherline"
>
> That depends on your shell, not Perl.
>
> Anno

How about Windows and Linux.




------------------------------

Date: Tue, 19 Oct 2004 15:07:54 +0200
From: Robert Sedlacek <phaylon@dunkelheit.at>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <pan.2004.10.19.13.07.54.428916@dunkelheit.at>

nntp wrote:

> How about Windows and Linux.

I see two ways:

1. Try it.
2. Find out, what Anno meaned with »shell«.

g,
Robert

-- 
http://www.dunkelheit.at/
   -<[::..::::..::::..]>-



------------------------------

Date: Tue, 19 Oct 2004 08:13:44 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <slrncna4o8.58a.tadmc@magna.augustmail.com>

nntp <nntp@rogers.com> wrote:

> My program needs @ARGV[1] as an input string. 
                   ^     ^
                   ^     ^
No it doesn't.

It may need $ARGV[0] as an input string though.


> In this input string,
> sometimes I need " and new line \n. How do I do this?


It depends on your shell, not on your choice of programming language.

You do not have a Perl question.


> Can I do
> perl perlfile.pl "somestring\"afterquote"
> perl perlfile.pl "somestring\nanotherline"


What happened when you tried it?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 19 Oct 2004 10:04:51 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <irGdnUcHFNmIgujcRVn-2w@adelphia.com>

nntp wrote:

> Can I do
> perl perlfile.pl "somestring\"afterquote"
> perl perlfile.pl "somestring\nanotherline"

Your question is about shells, not Perl. The answer would be exactly the 
same, for example, if you were doing this:

python pyfile.py "somestring\nanotherline"

Having said that - your second should probably work in most popular UNIX 
shells.

Also, Perl inherited its "here-doc" syntax from shells - Bash, for 
example, can use the same <<"FOO" syntax to define multiline strings 
that Perl uses. Again though, it's a question about the shell you're 
using, not Perl.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Tue, 19 Oct 2004 23:24:07 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <p5man0pltr6ksngkhvd92kv98nsd2eqqgu@4ax.com>

On Tue, 19 Oct 2004 09:10:14 -0400, "nntp" <nntp@rogers.com> wrote:

>> That depends on your shell, not Perl.
>
>How about Windows and Linux.

Is this supposed to be a question? If so, then how about asking one
that does make sense?!?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 19 Oct 2004 23:24:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <8ckan0dlkclo6nktnmr0pknlfnfcgi5cbf@4ax.com>

On 19 Oct 2004 13:08:02 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>nntp <nntp@rogers.com> wrote in comp.lang.perl.misc:
[snip]
>> Can I do
>> perl perlfile.pl "somestring\"afterquote"
>> perl perlfile.pl "somestring\nanotherline"
>
>That depends on your shell, not Perl.

Also, have you (nntp, not Anno!) tried?!?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Tue, 19 Oct 2004 16:36:31 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <slrncnb26v.1s4.tadmc@magna.augustmail.com>

nntp <nntp@rogers.com> wrote:

>> > Can I do
>> > perl perlfile.pl "somestring\"afterquote"
>> > perl perlfile.pl "somestring\nanotherline"
>>
>> That depends on your shell, not Perl.


> How about Windows and Linux.


This is a Perl newsgroup.

This is not a Windows newsgroup.

This is not a Linux newsgroup.

Ask Perl questions in a Perl newsgroup.

Ask Windows questions in a Windows newsgroup.

Ask Linux questions in a Linux newsgroup.

It is not a hard concept, please DO NOT make off-topic postings.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Tue, 19 Oct 2004 16:37:52 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How do I use " and \n in @ARGV[1]?
Message-Id: <slrncnb29g.1s4.tadmc@magna.augustmail.com>

nntp <nntp@rogers.com> wrote:

>> > My program needs @ARGV[1] as an input string.

>> That depends on your shell, not Perl.


I asked you to provide attributions when quoting someone, yet here
are more unattributed quotes.

I give up, into the killfile you go!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 7270
***************************************


home help back first fref pref prev next nref lref last post