Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Reinventing a square wheel

Thread Tools

Reinventing a square wheel

Wes Groleau
Posts: n/a
OK, this has probably already been done a hundred times,
but I wanted to get some practice. But I'm doing something
wrong and I can't see it.

File "PickOne" is:


@words = <STDIN>;

$new_word = $words[rand(@words)];

chomp ($new_word);

print ($new_word);

shell command

ls | PickOne

has no output. If I use `ls` instead of stdin,
it does give me one filename each time.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
UNICODE: reinventing the wheel with WSUCONV Willow C Programming 5 03-13-2012 11:28 AM
Reinventing Browser Tabs Lawrence D'Oliveiro NZ Computing 1 05-19-2009 10:50 AM
Need assistance reinventing the wheel..... jim Javascript 1 10-27-2008 01:33 AM
Re: NUL to terminate strings; was reinventing ASCII? Morris Dovey C Programming 41 04-13-2008 01:27 AM
SRT DIvision, Square root and reciprocal square root VHDL 0 05-27-2004 06:23 AM