Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Formatting text-Create table -perl Tk

by zentara (Archbishop)
on Dec 04, 2012 at 10:40 UTC ( #1007054=note: print w/replies, xml ) Need Help??

in reply to Formatting text-Create table -perl Tk

You can try the format method. See perldoc format.
#!/usr/bin/perl my $foo = ''; open FH, '+>', \$foo or die $!; format FH_TOP = WHO COMMAND OUTPUT USER TERMINAL DATE & TIME LOCATION ----------------------------------------------------------- . my @who_output= `who`; foreach my $line (@who_output) { my ($userid,$terminal,$month,$day,$time,$location) = split(/\s+/,$line +); chomp $location; format FH = @<<<<<<< @<<<<<<<<< @<<< @<< @<<<<< @<<<<<<<<<<<< $userid $terminal $month $day $time $location . write FH; } #print "$foo\n"; use Tk; my $top = new MainWindow; my $txt = $top->Scrolled("Text")->pack; $txt->insert('end', "$foo\n") ; MainLoop;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007054]
[stevieb]: I think that placing the * in C when dealing with pointers is akin to keeping separated the circumfix op from the inner ref in Perl: @{ $aref };, which is all personal preference. In perl, I'm good. C, don't know what I like
[stevieb]: ...yet. Still too newbie

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-01-24 02:31 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (200 votes). Check out past polls.