Ask a Question related to PERL Miscellaneous, Design and Development.
-
Dan Jacobson #1
$# is deprecated, $OFMT doesn't work
$ perl -wle '$#="%.2f";print 1/3'
Use of $# is deprecated at -e line 1.
0.33
$ man perlvar
$ perl -wle '$OFMT="%.2f";print 1/3'
Name "main::OFMT" used only once: possible typo at -e line 1.
0.333333333333333
What is the matter with me?
perl, v5.8.0
Dan Jacobson Guest
-
Deprecated Code??
HI TEAM!!! Is there a way to simplify this code/? Is setProperty and getProperty deprecated as of MX 2004? ti = 20; for (n=0; n<ti; n++) {... -
deprecated
" In scalar context, returns the number of fields found and splits into the "@_" array. Use of split in scalar context is deprecated, however,... -
Is -w deprecated?
In the book I bought, Programming Perl, by O'Reilly they say I should use warnings instead of -w after the shebang and the perl path because -w is... -
deprecated function list?
Hi list, I've a problem with the mime_content_type function. each time I use them, my script bug but in my php.ini the extension... -
hex is deprecated?
hex isn't deprecated, but bgcolor is. You should be using styles for that. It is soooo much easier than doing it in your html. Why resist?? --... -
James Willmore #2
Re: $# is deprecated, $OFMT doesn't work
On Wed, 10 Sep 2003 12:23:58 +0800
Dan Jacobson <jidanni@jidanni.org> wrote:
Why not just use printf?> $ perl -wle '$#="%.2f";print 1/3'
> Use of $# is deprecated at -e line 1.
> 0.33
> $ man perlvar
> $ perl -wle '$OFMT="%.2f";print 1/3'
> Name "main::OFMT" used only once: possible typo at -e line 1.
> 0.333333333333333
>
> What is the matter with me?
> perl, v5.8.0
jim@maxine:~> perl -wle 'printf "%.2f\n", 1/3'
0.33
jim@maxine:~>
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. [url]http://www.gnu.org/licenses/gpl.txt[/url]
for more information.
a fortune quote ...
Life is like a simile.
James Willmore Guest
-
Steven Smolinski #3
Re: $# is deprecated, $OFMT doesn't work
Dan Jacobson <jidanni@jidanni.org> wrote:
Note to OP: in perlvar it should tell you that to use the long names of> $ perl -wle '$OFMT="%.2f";print 1/3'
> Name "main::OFMT" used only once: possible typo at -e line 1.
> 0.333333333333333
the punctuation variables you need to:
use English;
But since $# is deprecated, see printf instead.
Question to everyone:
Should perlvar in 5.8.0 still mention $OFMT when it has been removed
from English.pm?
I don't know how to submit a documentation patch to p5p, but I suppose I
can learn.
Steve
Steven Smolinski Guest
-
Tassilo v. Parseval #4
Re: $# is deprecated, $OFMT doesn't work
Also sprach Dan Jacobson:
If you want to use the long variable names for the punctuation> $ perl -wle '$#="%.2f";print 1/3'
> Use of $# is deprecated at -e line 1.
> 0.33
> $ man perlvar
> $ perl -wle '$OFMT="%.2f";print 1/3'
> Name "main::OFMT" used only once: possible typo at -e line 1.
> 0.333333333333333
variables, you need the English module. However, $OFMT isn't handled by
that because $# is deprecated. Therefore:
*OFMT = \$#;
$OFMT = "%.2f\n";
print 1/3;
__END__
0.33
The first line will make $OFMT an alias for $#.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest
-
Tassilo v. Parseval #5
Re: $# is deprecated, $OFMT doesn't work
Also sprach Steven Smolinski:
I just wondered about that, too, when I saw that alias to the deprecated> Dan Jacobson <jidanni@jidanni.org> wrote:>>> $ perl -wle '$OFMT="%.2f";print 1/3'
>> Name "main::OFMT" used only once: possible typo at -e line 1.
>> 0.333333333333333
> Note to OP: in perlvar it should tell you that to use the long names of
> the punctuation variables you need to:
>
> use English;
>
> But since $# is deprecated, see printf instead.
>
>
> Question to everyone:
>
> Should perlvar in 5.8.0 still mention $OFMT when it has been removed
> from English.pm?
variables are commented out in English.pm. Either perlvar removes the
symbolic name of deprecated variables or the aliases remain in
English.
perlvar.pod is just a plain file in the Perl source tree so you'd patch> I don't know how to submit a documentation patch to p5p, but I suppose I
> can learn.
it as any other file. See 'perldoc perlhack' for an instruction on how
to patch Perl and submit those patches.
Essentially: rsync one of the branches (blead, aka 5.9.0 or maint
[5.8.1-to-come]), cp pod/perlvar.pod to pod/perlvar.pod~ or so, patch
perlvar.pod, run
diff -u pod/perlvar.pod~ pod/perlvar.pod > patch
and send the patch as attachment to [email]perl5-porters@perl.org[/email] while
mentioning against which branch this patch is (althouth the porters
might figure that out themselves).
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest
-
Abigail #6
Re: $# is deprecated, $OFMT doesn't work
Steven Smolinski (steven.smolinski@sympatico.ca) wrote on MMMDCLXII
September MCMXCIII in <URL:news:2fz7b.3002$z5.237577@news20.bellglobal.c om>:
)) Dan Jacobson <jidanni@jidanni.org> wrote:
)) > $ perl -wle '$OFMT="%.2f";print 1/3'
)) > Name "main::OFMT" used only once: possible typo at -e line 1.
)) > 0.333333333333333
))
)) Note to OP: in perlvar it should tell you that to use the long names of
)) the punctuation variables you need to:
))
)) use English;
))
)) But since $# is deprecated, see printf instead.
))
))
)) Question to everyone:
))
)) Should perlvar in 5.8.0 still mention $OFMT when it has been removed
)) from English.pm?
))
)) I don't know how to submit a documentation patch to p5p, but I suppose I
)) can learn.
I've submitted a patch. Note that in the 5.8.1 track the OFMT
equivalent for $# was already removed from perlvar.
Abigail
--
($;,$_,$|,$\)=("\@\x7Fy~*kde~box*Zoxf*Bkiaox"," "x25,1,"\r");
{vec($_=>1+$"=>$^F<<$^F)=ord($/^substr$;=>$"=int rand 24=>1);
print&&select$,,$,,$,,$|/($|+tr/ //c);redo if y/ //>$^F**2};
Abigail Guest
-
Tassilo v. Parseval #7
Re: $# is deprecated, $OFMT doesn't work
Also sprach Abigail:
> Steven Smolinski (steven.smolinski@sympatico.ca) wrote on MMMDCLXII
> September MCMXCIII in <URL:news:2fz7b.3002$z5.237577@news20.bellglobal.c om>:Hmmh, was it? I get (for RC1 though):> )) Question to everyone:
> ))
> )) Should perlvar in 5.8.0 still mention $OFMT when it has been removed
> )) from English.pm?
> ))
> )) I don't know how to submit a documentation patch to p5p, but I suppose I
> )) can learn.
>
>
> I've submitted a patch. Note that in the 5.8.1 track the OFMT
> equivalent for $# was already removed from perlvar.
ethan@ethan:~$ perldoc5.8.1 -t perlvar | grep -A1 -m1 OFMT
$OFMT
$# The output format for printed numbers. This variable is a
Even in my not-so-lang-ago-synced blead perlvar.pod still mentions it.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest
-
Abigail #8
Re: $# is deprecated, $OFMT doesn't work
Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDCLXII
September MCMXCIII in <URL:news:bjmmt8$gln$1@nets3.rz.RWTH-Aachen.DE>:
"" Also sprach Abigail:
""
"" > Steven Smolinski (steven.smolinski@sympatico.ca) wrote on MMMDCLXII
"" > September MCMXCIII in <URL:news:2fz7b.3002$z5.237577@news20.bellglobal.c om>:
""
"" > )) Question to everyone:
"" > ))
"" > )) Should perlvar in 5.8.0 still mention $OFMT when it has been removed
"" > )) from English.pm?
"" > ))
"" > )) I don't know how to submit a documentation patch to p5p, but I suppose I
"" > )) can learn.
"" >
"" >
"" > I've submitted a patch. Note that in the 5.8.1 track the OFMT
"" > equivalent for $# was already removed from perlvar.
""
"" Hmmh, was it? I get (for RC1 though):
""
"" ethan@ethan:~$ perldoc5.8.1 -t perlvar | grep -A1 -m1 OFMT
"" $OFMT
"" $# The output format for printed numbers. This variable is a
""
"" Even in my not-so-lang-ago-synced blead perlvar.pod still mentions it.
You are right. After submitting the patch, I grepped for OFMT as well,
but grepped against the patched file.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
Abigail Guest
-
Tassilo v. Parseval #9
Re: $# is deprecated, $OFMT doesn't work
Also sprach Abigail:
> Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDCLXII
> September MCMXCIII in <URL:news:bjmmt8$gln$1@nets3.rz.RWTH-Aachen.DE>:
> "" Also sprach Abigail:Haha, you first removed those occurances and immediately after that> "" > I've submitted a patch. Note that in the 5.8.1 track the OFMT
> "" > equivalent for $# was already removed from perlvar.
> ""
> "" Hmmh, was it? I get (for RC1 though):
> ""
> "" ethan@ethan:~$ perldoc5.8.1 -t perlvar | grep -A1 -m1 OFMT
> "" $OFMT
> "" $# The output format for printed numbers. This variable is a
> ""
> "" Even in my not-so-lang-ago-synced blead perlvar.pod still mentions it.
>
>
> You are right. After submitting the patch, I grepped for OFMT as well,
> but grepped against the patched file.
checked whether they had been there at all in the first place? ;-)
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest
-
Anno Siegel #10
Re: $# is deprecated, $OFMT doesn't work
Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
[how to prepare a perl patch]
Minor correction: Simply append the patch to the mail. Sending it> diff -u pod/perlvar.pod~ pod/perlvar.pod > patch
>
> and send the patch as attachment to [email]perl5-porters@perl.org[/email] while
as an attachment actually makes it harder for the receiver, since
the patch program can deal directly with a mail message that ends
with a patch.
Anno
Anno Siegel Guest
-
Abigail #11
Re: $# is deprecated, $OFMT doesn't work
Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDCLXII
September MCMXCIII in <URL:news:bjmoid$ie4$1@nets3.rz.RWTH-Aachen.DE>:
}} Also sprach Abigail:
}}
}} > Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDCLXII
}} > September MCMXCIII in <URL:news:bjmmt8$gln$1@nets3.rz.RWTH-Aachen.DE>:
}} > "" Also sprach Abigail:
}}
}} > "" > I've submitted a patch. Note that in the 5.8.1 track the OFMT
}} > "" > equivalent for $# was already removed from perlvar.
}} > ""
}} > "" Hmmh, was it? I get (for RC1 though):
}} > ""
}} > "" ethan@ethan:~$ perldoc5.8.1 -t perlvar | grep -A1 -m1 OFMT
}} > "" $OFMT
}} > "" $# The output format for printed numbers. This variable is
}} > ""
}} > "" Even in my not-so-lang-ago-synced blead perlvar.pod still mentions it.
}} >
}} >
}} > You are right. After submitting the patch, I grepped for OFMT as well,
}} > but grepped against the patched file.
}}
}} Haha, you first removed those occurances and immediately after that
}} checked whether they had been there at all in the first place? ;-)
Yeah, because in English.pm there were 4 variables outcommented, and
only two of them were still mentioned in perlvar. And I've an attention
span of approx. 0.2 seconds, so I forgot which ones were already
removed.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
..qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
..qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
Abigail Guest
-
Tassilo v. Parseval #12
Re: $# is deprecated, $OFMT doesn't work
Also sprach Anno Siegel:
That might be the best solution assuming you have a decent mailer. The> Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
>
> [how to prepare a perl patch]
>>>> diff -u pod/perlvar.pod~ pod/perlvar.pod > patch
>>
>> and send the patch as attachment to [email]perl5-porters@perl.org[/email] while
> Minor correction: Simply append the patch to the mail. Sending it
> as an attachment actually makes it harder for the receiver, since
> the patch program can deal directly with a mail message that ends
> with a patch.
indecent ones are likely to render the patch unsubmittable by
introducing bogus line-breaks or such. Porting/patching.pod states:
Submitting your patch
Mailers
Please, please, please (get the point? 8-) don't use a mailer that
word wraps your patch. This leaves the patch essentially worthless
to the maintainers.
Unfortunately many mailers word wrap the main text of messages, but
luckily you can usually send your patches as email attachments
without them getting "helpfully" word wrapped.
I don't think my MUA is one of the evil ones, but the above somehow made
me cautious enough to always use attachments. I am a careful person. :-)
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
Tassilo v. Parseval Guest
-
Anno Siegel #13
Re: $# is deprecated, $OFMT doesn't work
Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in comp.lang.perl.misc:
That is indeed another aspect. Don't patch sources with long lines :)> Also sprach Anno Siegel:
>> comp.lang.perl.misc:> > Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de> wrote in>> >
> > [how to prepare a perl patch]
> >> >> >> diff -u pod/perlvar.pod~ pod/perlvar.pod > patch
> >>
> >> and send the patch as attachment to [email]perl5-porters@perl.org[/email] while
> > Minor correction: Simply append the patch to the mail. Sending it
> > as an attachment actually makes it harder for the receiver, since
> > the patch program can deal directly with a mail message that ends
> > with a patch.
> That might be the best solution assuming you have a decent mailer. The
> indecent ones are likely to render the patch unsubmittable by
> introducing bogus line-breaks or such. Porting/patching.pod states:
I did that too (send attachments), until someone (Hugo?) asked me not to.> Submitting your patch
> Mailers
> Please, please, please (get the point? 8-) don't use a mailer that
> word wraps your patch. This leaves the patch essentially worthless
> to the maintainers.
>
> Unfortunately many mailers word wrap the main text of messages, but
> luckily you can usually send your patches as email attachments
> without them getting "helpfully" word wrapped.
>
> I don't think my MUA is one of the evil ones, but the above somehow made
> me cautious enough to always use attachments. I am a careful person. :-)
When sending a patch from somewhere I haven't done it before, I mail it
to myself and see if it arrives in good shape.
Anno
Anno Siegel Guest
-
Steven Smolinski #14
Re: $# is deprecated, $OFMT doesn't work
Tassilo v. Parseval <tassilo.parseval@rwth-aachen.de> wrote:
> Also sprach Steven Smolinski:Thanks for the primer. Next time I won't let Abigail beat me to it.>>> I don't know how to submit a documentation patch to p5p, but I
>> suppose I can learn.
> perlvar.pod is just a plain file in the Perl source tree so you'd patch
> it as any other file. See 'perldoc perlhack' for an instruction on how
> to patch Perl and submit those patches.
> [...]
Steve
--
Steven Smolinski => [url]http://arbiter.ca/[/url]
GnuPG Public Key => [url]http://arbiter.ca/steves_public_key.txt[/url]
=> or email me with 'auto-key' in the subject.
Key Fingerprint => 08C8 6481 3A7B 2A1C 7C26 A5FC 1A1B 66AB F637 495D
Steven Smolinski Guest



Reply With Quote

