12-28-2002
You could always do this in Perl - in fact, there are answers in this forum on how to do it as I've helped to write a couple!
10 More Discussions You Might Find Interesting
1. IP Networking
need help!!
need a ping program written in c with the explanations as to what each variable,function does!!! please help!! (4 Replies)
Discussion started by: sachin_zeus
4 Replies
2. Programming
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:
---------... (1 Reply)
Discussion started by: vvaidyan
1 Replies
3. Programming
Hi,
I wanted to know if i can write a program using switches and signals, etc to trace execution of other unix program which calls c program internally.
If yes how? If not with signals and switches then are there any other methods apart from debugging with gdb/dbx. (3 Replies)
Discussion started by: jiten_hegde
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
i want to write a script that executes a program (exec?) .
this program then requires a filename as input.
how do i give it this input in the script so the program will be complete run and close by the script.
e.g.
exec prog.exe
program then asks for filename
"enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies
5. Programming
I wrote a simple program that generates a random word 10,000,000 times.
I wrote it in python, then in C++ and compared the two completion times. The python script was faster! Is that normal? Why would the python script be faster? I was under the impression that C++ was faster. What are some of... (2 Replies)
Discussion started by: cbreiny
2 Replies
6. Homework & Coursework Questions
Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies
7. Shell Programming and Scripting
Hi,
I develop simple animation ping script on Solaris Platform. It is like Cisco ping.
Examples and source code are below.
bash-3.00$ gokcell 152.155.180.8 30
Sending 30 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.
% 93.33 success... % 6.66 packet loss...... (1 Reply)
Discussion started by: gokcell
1 Replies
8. Shell Programming and Scripting
Hi
I am using perl to ping a list of nodes - with script below :
$p = Net::Ping->new("icmp");
if ($p->ping($host,1)){
print "$host is alive.\n";
}
else {
print "$host is unreacheable.\n";
}
$p->close();... (4 Replies)
Discussion started by: tavanagh
4 Replies
9. Programming
help with bash script!
im am working on this script to make sure my server will stay online, so i made this script..
HOSTS="192.168.138.155"
COUNT=4
pingtest(){
for myhost in "$@"
do
ping -c "$COUNT" "$myhost" &&return 1
done
return 0
}
if pingtest $HOSTS
#100% failed... (4 Replies)
Discussion started by: mort3924
4 Replies
10. Shell Programming and Scripting
I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade.
I have:
if ( $response =~ m/^/ ) {
$user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
LEARN ABOUT DEBIAN
mdom::token::whitespace
MDOM::Token::Whitespace(3pm) User Contributed Perl Documentation MDOM::Token::Whitespace(3pm)
NAME
MDOM::Token::Whitespace - Tokens representing ordinary white space
INHERITANCE
MDOM::Token::Whitespace
isa MDOM::Token
isa MDOM::Element
DESCRIPTION
As a full "round-trip" parser, MDOM records every last byte in a file and ensure that it is included in the MDOM::Document object.
This even includes whitespace. In fact, Perl documents are seen as "floating in a sea of whitespace", and thus any document will contain
vast quantities of "MDOM::Token::Whitespace" objects.
For the most part, you shouldn't notice them. Or at least, you shouldn't have to notice them.
This means doing things like consistently using the "S for significant" series of MDOM::Node and MDOM::Element methods to do things.
If you want the nth child element, you should be using "schild" rather than "child", and likewise "snext_sibling", "sprevious_sibling", and
so on and so forth.
METHODS
Again, for the most part you should really not need to do anything very significant with whitespace.
But there are a couple of convenience methods provided, beyond those provided by the parent MDOM::Token and MDOM::Element classes.
null
Because MDOM sees documents as sitting on a sort of substrate made of whitespace, there are a couple of corner cases that get particularly
nasty if they don't find whitespace in certain places.
Imagine walking down the beach to go into the ocean, and then quite unexpectedly falling off the side of the planet. Well it's somewhat
equivalent to that, including the whole screaming death bit.
The "null" method is a convenience provided to get some internals out of some of these corner cases.
Specifically it create a whitespace token that represents nothing, or at least the null string ''. It's a handy way to have some
"whitespace" right where you need it, without having to have any actual characters.
tidy
"tidy" is a convenience method for removing unneeded whitespace.
Specifically, it removes any whitespace from the end of a line.
Note that this doesn't include POD, where you may well need to keep certain types of whitespace. The entire POD chunk lives in its own
MDOM::Token::Pod object.
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2006 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.12.4 2011-08-28 MDOM::Token::Whitespace(3pm)