Today around 6:34pm, Mike Pastore hammered out this masterpiece:
: Perl++
PERL
[Casey ducks and runs for cover ;]
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n"
character, and the first character) are all efficient string
Where, oh where, did you find these? And why, oh why, haven't I found
them on CPAN already?
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.ne
#x27;
This might be nice if you can set your environment vars to have a few
defaults such as autoflush(1).
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce
Today around 11:52am, Philip Newton hammered out this masterpiece:
: On Tue, 15 Aug 2000, Casey R. Tweten wrote:
:
: > cat /etc/passwd | perl -nfe 'print((split/:/)[0])'
: >
: > -f is just like $|=1 or, for example, $fh->autoflush(1);
:
: When did -f come into bei
Today around 11:01am, Jonathan Scott Duff hammered out this masterpiece:
: On Tue, Aug 15, 2000 at 09:14:20AM -0400, Casey R. Tweten wrote:
: > This, by the way (even as a test) was agravating to me because in order to
: > get decent output I really had to do this:
: >
: > cat
at, look at the prefix.
Along similar lines, what happens to function prototypes?
sub my_func($$$) {}
That isn't too helpful if you're using it like this:
myfunc( "Scalar", [ "Array", "Ref" ], { Hash => 'Ref' } );
--
print(join('
(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce
think most of you get the idea. This way, you could still say in your
module:
use perlrc qw/:all/;
because there would be a naming convention involved similar to:
Module RC File
-- ---
CGI.pm CGI.rc
Shell.pmShell.rc
File/Find.pmFile/Find.rc
And so o
Today around 7:17pm, Casey R. Tweten hammered out this masterpiece:
: Today around 2:34pm, Nathan Wiger hammered out this masterpiece:
:
: : > Think on this:
: : >
: : > use perlrc qw/Resource1 Resource5/; # Import only named 'Resources'
: : >
:
more managable than a .perlrc that get's applied globaly
without asking for it.
* No, this doesn't exist right now. I know.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print &qu
agma ( attempted because as far as I know, neither of us has touched it in a
long while ) that degreases line noise in terms of punctuations, sorta. It's
more verbose anyhow, where:
@{ $hashref->{key} };
becomes:
ARRAY{ $hashref->{key} };
And the same holds true for SCALAR, HASH, CODE, GL
Today around 2:04pm, Casey R. Tweten hammered out this masterpiece:
: Today around 10:45am, Steve Fink hammered out this masterpiece:
:
: : Ted Ashton wrote:
: : >
: : > > all
: : > > dereferencing c
SCALAR $hashref->{scl};
: print "\n";
: print join(',', ARRAY $hashref->{ary}), "\n";
:
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",&
d. The above should yeild
something like:
KeyOne
KeyTwo
Rather than that error.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),&
k something like this:
sub keys {
my %hash = @_;
return keys %hash;
}
What is so hard about that? Besides, it's intuitive. If I were to write my own
keys function, it would behave like above no matter what. I would expect a
list, and return a list.
--
print(join(' ', qw(Casey R.
to be, then no. Why on earth would
anyone suggest such a thing? How obsurd!
: I don't see that flying.
No, in that case, I don't either.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'
Today around 10:11am, John Porter hammered out this masterpiece:
: Casey R. Tweten wrote:
: >
: > sub func {
: > return qw/KeyOne Value1 KeyTwo Value2/;
: > }
: >
: > print "$_\n" foreach keys &func();
:
: Please. There are ways -- well, just one
ened to making easy things easy, out of the box?
: And if I want to be a masochist and have my code scrutinized like hell,
: using strict, -wT ?
:
: use strict 'hash';
: no strict 'hash';
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECT
#x27;s not documented. Perhaps, at least for the current version
of Perl, this should be documented in perlfunc under keys(), values() and
each(). Also in perlfaq4, although I bet this is not a frequent question.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL
ou must use this syntax to
force that to work:
@array = keys %{{@array}};
''
Or something like that.
This suggestion was brought up as a means to make these functions more user
friendly.
If it's impossible, then I'll be glad to forget about it.
[Insert many replies that agree
other people like me to understand this
problem/bug/feature/not too noticed 'thing'.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{si
Today around 4:07pm, John Porter hammered out this masterpiece:
: Casey R. Tweten wrote:
: >
: > Removing intermediate data structures is easy in Perl, but not this case,
:
: C, etc. must have data structures to work on. There's no "getting rid"
: of them.
Perl can crea
NG, PATTERN)
: 3 match(PATTERN, FLAGS)
: 4 match(PATTERN)
:
: because you can't really tell 2 from 3.
If qr() were required for PATTERN, would this become less of an issue? Or no
issue?
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]
rfcnumber . '.pod' );
my $matched = $rfcpage =~ s/$string//isgo;
print qq(RFC number $rfcnumber matches $matched
time(s):\t$rfcroot$rfcnumber.pod\n) if $matched;
}
__END__
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
Today around 4:30pm, Tom Christiansen hammered out this masterpiece:
: print <'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patche
ut fast if no one
minds.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce
tansparent shell
ops in Perl, may ( or may not ) be a good application for this suggested
pragma. I tend to fall toward the 'may not' category.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt
ck' it into an
array and print in in a pretty manner.
printf(
"%4d/%02d/%02d %02d:%02d%02d\n",
unpack( 'A4A2A2A2A2A2', '2918123847' )
);
If printf is perlish, so is unpack, IMHO ;-)
--
print(join(' ', qw(Casey R. Tweten
rue.";
}
I'm only half joking because I've been thinking about writing this for a
while. However, I would probably never use it, personally, I can see times when
others have wanted something close.
=end
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'
ldoc strict
:perldoc -f my
:
: do find out about the "use strict" part.
:
:
:
:
: Please try to find *appropriate* places to ask
: your questions in the future.
:
:
: --
: Tad McClellan SGML consulting
: [EMAIL PROTECTED] Per
?
No, and good luck getting getting your box to work after installing
5.004 at /usr ( not /usr/local ).
: 3. Anyone knows which was the previous (original) version, and
: where can I found it?
Look at the CPAN for Perl 5.004
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>
g: 32 wallclock secs (31.15 usr + 0.08 sys = 31.23 CPU) @ 320170.76/s
(n=1000)
substr: 34 wallclock secs (32.87 usr + 0.13 sys = 33.00 CPU) @ 303030.30/s
(n=1000)
Doesn't seem like that much gain from chop() to substr(), but it's
still a gain. 20k/s more...
--
print
nsidered for the Standard Distro, too.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce
33 matches
Mail list logo