in reply to the variable is lost

I don't know what's causing this, but you should stay away from $a and $b as variable names, as they are reserved for sort (perlvar).

Furthermore, I don't understand why you are using unix commands in system() despite running on windows.

Replies are listed 'Best First'.
Re^2: the variable is lost
by cruise (Acolyte) on Mar 09, 2012 at 09:06 UTC
    the question is not the variable's name.
    when i change variable name warning still exist
    install gnuwin32 you can use ls command in windows

      FWIW, using $a and $b outside of sort is always a mistake

        FWIW, using $a and $b outside of sort is always a mistake
        The special variables $a and $b are also used by List::Util's reduce function and by List::MoreUtils's pairwise function.

        For a grasshopper, just fresh out of the egg, and not really having a license yet to come anywhere near a keyboard, this is decent advice. It's the level of advice you give to a toddler who's about to start crawling. "Hot, don't touch".

        Anyone who has half a braincell he can fire up once a blue moon, however, will see how silly that is.

        A lot of code doesn't sort. Most code that does sort, doesn't even use the variant that makes Perl stuff $a and $b. And even if you do, even then you have to work hard to make a use of $a and $b make things mess up.

        If you really need to have a Pavlov reaction when you see an $a and/or a $b, and blind yourself from the fact a poster may have used well known example variable names, please keep your urges private, and don't hit that "create" button. It doesn't add any value.