Thread Hash als Option missbrauchen (118 answers)
Opened by bloonix at 2005-12-19 02:24

Dubu
 2005-12-28 00:15
#61071 #61071
User since
2003-08-04
2145 Artikel
ModeratorIn + EditorIn

user image
[quote=esskar,23.12.2005, 13:10][quote=Dubu,23.12.2005, 09:44]Und das "fat comma" (=>) quotet auch den Ausdruck links von sich, sofern er die Form eines Identifiers hat, also kann man auch das 'passwd' ohne Anfuehrungszeichen schreiben. (Die Einschraenkung mit dem Identifier gilt uebrigens auch fuer das Quoten innerhalb von {}.)[/quote]
nicht ganz richtig:
ein identifier (also eine variable) darf nicht mit einer Zahl anfangen (zumindest kein user-spezifischer) ... der Ausdruck links neben dem Komma schon.
[/quote]
*pfft*

Code: (dl )
1
2
3
4
5
6
~> perl -Mstrict -Mwarnings -le 'my %foo = ( abc1 => "hello" ); print "ok"'
ok
~> perl -Mstrict -Mwarnings -le 'my %foo = ( 1abc => "hello" ); print "ok"'
syntax error at -e line 1, near "1abc"
Execution of -e aborted due to compilation errors.
~>



Quote
und von der Schönheit wegen, würde ich meinen, dass wenn man einmal quotet, man immer quotet

ACK

View full thread Hash als Option missbrauchen