Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

How to run our folders and files with url using perl program?

by finddata (Sexton)
on Mar 21, 2017 at 12:27 UTC ( #1185342=perlquestion: print w/replies, xml ) Need Help??

finddata has asked for the wisdom of the Perl Monks concerning the following question:

I had included the following line in my script to link the url and open its directories from url.

But am not sure does the url is correct and how to link the folders with url.

Please help me.Thanks in advance.

open my $fh, '<', $file or die "Can't open $file: $!"; while (my $line=<$fh>) { chomp $line; for($line) { s/\&//g; s/[\\\_\@\_]//g; s/COMMENT//g; } my @data = split /:/, $line; my $class = $data[0] ? 'normal' : 'bold'; print $fh_out qq[<tr class="$class">]; my $href="http://www.iad.log.com/apps/v/kb/dms"; my $check=0; my $dolink=$data[0] !~ m/[\=\%]/; for my $word(@data){ $check++; print $fh_out '<td>'; if($check==1 && $dolink ) { print $fh_out '<a href="'.$href.'" >'.$word.'</a>'; } else { print $fh_out $word;} print $fh_out '</td>'; } } }

And How to check does am running with correct url?

Replies are listed 'Best First'.
Re: How to run our folders and files with url using perl program?
by marto (Archbishop) on Mar 21, 2017 at 12:38 UTC

    $href is unchanged, all links you print to the file have the same URL. Please post a question which makes sense to people reading it. You don't mention what defines a "correct" URL, or how this relates to a "folder".

Re: How to run our folders and files with url using perl program?
by Corion (Pope) on Mar 21, 2017 at 12:35 UTC

    What do you mean by "But am not sure does the url is correct"? What makes a correct URL different from an incorrect URL? How can you check that?

    What do you mean by "how to link the folders with url"? What are "folders" and how would you want to link them?

    You did again not show relevant input data and you also did not show the output data you get and the output data you want. Please show us the relevant input data and relevant output. Please also explain where the output you get is different from the output you want and the rules how the output you want should be created from the input you have.

    Also see Re^3: Remove hyperlinks from the lines which have special character?, from which much of your code seems to stem from.

Re: How to run our folders and files with url using perl program?
by huck (Parson) on Mar 21, 2017 at 12:46 UTC

    One way to tell if it is the right url is to click on it and see where it goes

    Otherwise if you cannot tell if it is the correct url i am afraid we cannot guess what the correct url should be. Then again maybe this is the right url. We have been around and around this before and you were unable to tell us what the correct url should be, and now you expect us to be able to know when you dont even know yourself. I suspect someone you work with should be able to tell you what the correct url should be.

    BTW,on another matter, there is a suspicious lack of any output of </tr> in that loop

Re: How to run our folders and files with url using perl program?
by Anonymous Monk on Mar 21, 2017 at 15:46 UTC
    log.com appears to be a parked domain. Whatever was there before is now gone. Sorry dude.
Re: How to run our folders and files with url using perl program?
by afoken (Canon) on Mar 22, 2017 at 06:31 UTC

    Stop being an idiot!

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1185342]
Approved by shmem
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2020-01-21 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?