LPM: Silly string question
Mik Firestone
fireston at lexmark.com
Fri Dec 10 14:58:29 CST 1999
If we are counting keystrokes, this is roughly equivalent but it doesn't
destroy the symmetry as much:
print "Size: $width\x78$height.\n";
I somehow don't think either symmetry nor keystrokes is enough to forgive this
ugliness, though. :)
On Fri, 10 Dec 1999, Rich Bowen wrote:
> David Hempy wrote:
> >
> > Okay, I want to print the size of an image, so I write:
> >
> > print "Size: $width x $height.\n";
> >
> > ...but I'd rather not have the spaces around the "x". Of course, the
> > following does not work:
> >
> > print "Size: $widthx$height.\n";
> >
> > So I ended up doing this:
> >
> > print "Size: $width" . "x$height.\n";
> >
> > Which is fine and dandy, but requires seven extra keystrokes (including
> > shifts). My goal in my professional life is to reduce the total number of
> > keystrokes my fingers must endure. Is there some "end of identifier"
> > operator or other perl magic that might fill the bill?
> >
> > Lazily yours,
> > -dave ;-)
>
> I tried the following:
>
> perl -e '$foo = "one"; $bar="two"; print "${foo}X${bar}\n";'
> oneXtwo
>
> It reduces your total character count, but if you are counting shift, it
> increases your key strokes.
>
> One could also do:
>
> perl -e '$foo = "one"; $bar="two"; print "${foo}X$bar\n";'
> oneXtwo
>
> Which does in fact reduce keystrokes, but looks a little less symmetric.
>
> Rich
>
--
Mik Firestone fireston at lexmark.com
When I become an Evil Overlord:
I will not waste time making my enemy's death look like an accident: I'm not
accountable to anyone and my other enemies wouldn't believe it.
More information about the Lexington-pm
mailing list