Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-w vs. -s #6875

Closed
p5pRT opened this issue Oct 28, 2003 · 6 comments
Closed

-w vs. -s #6875

p5pRT opened this issue Oct 28, 2003 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 28, 2003

Migrated from rt.perl.org#24343 (status was 'resolved')

Searchable as RT24343$

@p5pRT
Copy link
Author

p5pRT commented Oct 28, 2003

From @jidanni

Created by @jidanni

Please see
http​://groups.google.com/groups?selm=u9vfq94k8v.fsf%40wcl-l.bham.ac.uk
for perlrun -s description addition, etc.

Perl Info

Flags:
    category=docs
    severity=low

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2003

From @schwern

On Tue, Oct 28, 2003 at 11​:35​:43PM -0000, Dan Jacobson wrote​:

Please see
http​://groups.google.com/groups?selm=u9vfq94k8v.fsf%40wcl-l.bham.ac.uk
for perlrun -s description addition, etc.

He's right, its not a bug. Perl is rightly informing you that you used $g
only once. However his suggested fix is less than ideal. Its pretty much
tanamount to "don't use -w with -s".

However, the only other fix I can think of, don't make "used only once"
warnings for variables in package main when -s is in use, might not be
ideal either.

But I've never used -s in real code, so I can't really judge.

--
Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/
I've just gone through a lung-crushing breakup with my blender and I don't
think I should screw my forehead alone tonight.

@p5pRT
Copy link
Author

p5pRT commented Oct 30, 2003

From @jidanni

Maybe as a quick solution, on the perlrun manpage's "-s" description,
note what might happen when one uses -w, and how to workaround.

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2004

From @smpeters

[jidanni@​jidanni.org - Thu Oct 30 02​:48​:31 2003]​:

Maybe as a quick solution, on the perlrun manpage's "-s" description,
note what might happen when one uses -w, and how to workaround.

Here's a patch for perlrun to clear this up.

Inline Patch
--- perlrun.pod.orig    Tue Dec 14 00:37:08 2004
+++ perlrun.pod Tue Dec 14 00:40:12 2004
@@ -730,7 +730,8 @@
     if ($xyz) { print "$xyz\n" }
 
 Do note that B<--help> creates the variable ${-help}, which is not
compliant \-with C\\. \+with C\\. Also\, when using this option on a script with warnings \+enabled you may get a lot of spurious "used only once" warnings\.

=item B<-S>

@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2004

From @rgs

Steve Peters via RT wrote​:

[jidanni@​jidanni.org - Thu Oct 30 02​:48​:31 2003]​:

Maybe as a quick solution, on the perlrun manpage's "-s" description,
note what might happen when one uses -w, and how to workaround.

Here's a patch for perlrun to clear this up.

--- perlrun.pod.orig Tue Dec 14 00​:37​:08 2004
+++ perlrun.pod Tue Dec 14 00​:40​:12 2004

Thanks, applied as 23648.

@p5pRT p5pRT closed this as completed Dec 14, 2004
@p5pRT
Copy link
Author

p5pRT commented Dec 14, 2004

@smpeters - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant