Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-06-2006, 09:24 AM   #1
Registered: Apr 2004
Distribution: Debian
Posts: 193

Rep: Reputation: 30
Perl question: Passing variable into function

Hi all

I am using the module HTML::TokeParser::Simple.

It currently works like i have below, where the input is a file.

How do I change it to accept a variable, multiline blob type of input?

Any help is appreciated. I do not understand how exactly the script will accept the file but not a variable input if i use a $_[0] for html_doc. Thinking i need the blob to have a @_[0] but an unable to figure out exactly how to get it. I am currently writing the file then reopening it I believe.

$remainingData = RemoveTags("$output_page");

sub RemoveTags {
  my $html_doc=shift;
  my $p = HTML::TokeParser::Simple->new ($html_doc);
  while ( my $token = $p->get_token ) {
    if( $token->is_text )
       $temp = $token->as_is;

  #do stuff here.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about passing using a function in an if statement. RHLinuxGUY Programming 7 09-04-2006 04:13 PM
C++ / Passing a variable by reference to a class member function. sepulture Programming 12 11-15-2005 10:23 PM
Bash Script Passing variable to Function nutthick Programming 2 02-02-2005 05:15 AM
passing passing variable in Java as reference djgerbavore Programming 3 11-10-2004 02:18 PM
Question about function with variable number of parameters xailer Programming 4 01-13-2004 11:37 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration