PerlZealot has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that I don't seem to get a value from this. Sure, pwd does its thing, but "dirgets" does not. What am I messing up?#!/usr/bin/env perl sub dirgets() { my $dirval; system(pwd); $dirval = <STDOUT>; return($dirval); } my $name; $name = &dirgets();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use of <STDOUT>
by locked_user sundialsvc4 (Abbot) on Mar 06, 2008 at 22:15 UTC | |
by Fletch (Bishop) on Mar 06, 2008 at 23:11 UTC | |
by PerlZealot (Acolyte) on Mar 06, 2008 at 23:42 UTC | |
|
Re: use of <STDOUT>
by igelkott (Priest) on Mar 06, 2008 at 22:19 UTC | |
|
Re: use of <STDOUT>
by TGI (Parson) on Mar 06, 2008 at 23:34 UTC | |
|
Re: use of <STDOUT>
by halfcountplus (Hermit) on Mar 07, 2008 at 13:24 UTC |