Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It could be a bug in the conditional operator '?:' #54

Closed
p5pRT opened this issue Jun 11, 1999 · 1 comment
Closed

It could be a bug in the conditional operator '?:' #54

p5pRT opened this issue Jun 11, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Jun 11, 1999

Migrated from rt.perl.org#856 (status was 'resolved')

Searchable as RT856$

@p5pRT
Copy link
Author

p5pRT commented Jun 11, 1999

From mneumann@clip.de

I had problems with the following code​:

($s_gid && $s_gid ne $gid{"$s_user"}) ? $grpc = "-g $group{\"$s_gid\"}"
: $grpc = "";
$s_shell ? $shc = "-s $s_shell" : $shc = "";
$s_hdir ? $dirc = "-d $s_hdir" : $dirc = "";

that doesn't ran, but the following​:

  ($s_gid && $s_gid ne $gid{"$s_user"}) ? {$grpc = "-g
$group{\"$s_gid\"}"} : {$grpc = ""};
  $s_shell ? {$shc = "-s $s_shell"} : {$shc = ""};
  $s_hdir ? {$dirc = "-d $s_hdir"} : {$dirc = ""};

ran correct.

The '?​:' - operator should be higher that the '=',
but it needs the '{}' or '()' for working.

I'm a greenhorn in programming Perl (i do it for three months), so I'm
not sure if it is reaaly a bug or my own mistake.
So if I don't get an answer from your I'll having a red head and I'll be
sure it IS my mistake....

bye

Markus Neumann

@p5pRT p5pRT closed this as completed Nov 28, 2003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant