Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Attempting to be more perl-ish
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Sheppard  
View profile  
 More options Nov 9 2012, 9:45 am
Newsgroups: perl.beginners
From: mshepp...@dyn.com (Matt Sheppard)
Date: Fri, 9 Nov 2012 09:33:23 -0500 (EST)
Local: Fri, Nov 9 2012 9:33 am
Subject: Attempting to be more perl-ish
Looking for advice on how to be more "perlish" in this bit of code. The idea is to allow execution of a script without pathing in the $0 parameter:

if ($0 =~ m/^\//) {
   exec("$0 @ARGV");

} else {

   exec("./$0 @ARGV");

}

Thanks,
M@

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John SJ Anderson  
View profile  
 More options Nov 9 2012, 9:45 am
Newsgroups: perl.beginners
From: geneh...@genehack.org (John SJ Anderson)
Date: Fri, 9 Nov 2012 06:37:17 -0800
Local: Fri, Nov 9 2012 9:37 am
Subject: Re: Attempting to be more perl-ish

On Nov 9, 2012, at 6:33 AM, Matt Sheppard <mshepp...@dyn.com> wrote:

> Looking for advice on how to be more "perlish" in this bit of code. The idea is to allow execution of a script without pathing in the $0 parameter:

This really feels like one of those "instead of asking how to do something, explain what you're trying to achieve" type deals. What are you actually trying to do here?

j.

--
John SJ Anderson // geneh...@genehack.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shawn H Corey  
View profile  
 More options Nov 9 2012, 10:00 am
Newsgroups: perl.beginners
From: shawnhco...@gmail.com (Shawn H Corey)
Date: Fri, 9 Nov 2012 09:41:56 -0500
Local: Fri, Nov 9 2012 9:41 am
Subject: Re: Attempting to be more perl-ish
On Fri, 9 Nov 2012 09:33:23 -0500 (EST)

Matt Sheppard <mshepp...@dyn.com> wrote:
> Looking for advice on how to be more "perlish" in this bit of code.
> The idea is to allow execution of a script without pathing in the $0
> parameter:

> if ($0 =~ m/^\//) {
>    exec("$0 @ARGV");
> } else {
>    exec("./$0 @ARGV");
> }

exec( $0, @ARGV );
die "could not create infinite loop\n";

--
Just my 0.00000002 million dollars worth,
        Shawn

Programming is as much about organization and communication
as it is about coding.

Why fit in when you can stand out?
        Dr. Seuss

The only way that problems get solved in real life is with a lot of
hard work on getting the details right.
        Linus Torvalds


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »