in reply to Re: Session ID Generator (Rolled My Own)
in thread Session ID Generator (Rolled My Own)

my @Chars = '0'..'9', 'A'..'Z', 'a'..'z';

That won't work as you might expect. You'll actually need:

my @Chars = ('0'..'9', 'A'..'Z', 'a'..'z');

Those parens aren't optional. Here's a demonstration:

$ perl -le 'my @one="0".."9","a".."z"; my @two=("0".."9","a".."z"); pr +int @one; print @two' 0123456789 0123456789abcdefghijklmnopqrstuvwxyz
-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Re: Session ID Generator (Rolled My Own)
by Zaxo (Archbishop) on Sep 15, 2002 at 05:30 UTC

    Right you are. I'm trying to understand that in terms of operator precedence. I think my erroneous one parses as: ( my @Chars = '0' .. '9'), 'A' .. 'Z', 'a' .. 'z'; sauoq++ for the catch.

    After Compline,
    Zaxo

Re: Re: Re: Session ID Generator (Rolled My Own)
by jerrygarciuh (Curate) on Sep 15, 2002 at 18:10 UTC
    Thanks for pointing that out sauoq!
    I would certainly never figured out the problem from the symptom!
    jg
    _____________________________________________________
    "The man who grasps principles can successfully select his own methods.
    The man who tries methods, ignoring principles, is sure to have trouble.
    ~ Ralph Waldo Emerson