Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to avoid mis-spelling hash keys?

by perrin (Chancellor)
on Jan 05, 2003 at 21:50 UTC ( #224474=note: print w/replies, xml ) Need Help??


in reply to how to avoid mis-spelling hash keys?

One very simple approach that works with older versions of Perl is to use lexical variables for your keys.

use strict; my $bar = 'bar'; my $foo{$bar} = 1; my $foo{$bear} = 1; # gives a compile error

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://224474]
help
Chatterbox?
[LanX]: RonW: yes I think something like inline::Rperl would be great, but Will is AFAIK not interested to go that way
[james28909]: well now i am using a for /f delims= %i IN(yt-dl) do set var=%i & ffmpeg -i "%var%" -a:c mp3 output.mp3 & set var=
[james28909]: just to get around not being able to do yt-dl | ffmpeg
[james28909]: learning is fun ISNT IT?!?!!??
[RonW]: that seems very weird to me
choroba submitted 2 talks to (YA|T)PC::EU
[RonW]: Choroba: I hope they get accepted

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-05-22 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?