find comments (Mojo::Dom)

22 views
Skip to first unread message

dal...@gmail.com

unread,
Dec 9, 2020, 3:26:35 AM12/9/20
to Mojolicious

I'm not sure if this is obvious or not.

I have some *very* old webpages what I need to have archived. But that site used Apache Server Side Includes (yes that old)

So I wanted to see if there are any of these magic comments left. Yes, I can easily do this with a normal find and grep in the commandline, but since I like working with Mojo::DOM I'd like to see if I could do it with this as well.

Is there any way of getting the comments other can looking at the type of all the tags?

I didn't see anything obvious via $dom -> find

Ideas?

/daleif

Lars Madsen

unread,
Dec 9, 2020, 3:52:00 AM12/9/20
to mojol...@googlegroups.com
Seems this is probably the easiest

for my $e ( $dom -> descendant_nodes -> each ) {
   next unless $e -> type eq 'comment';
   say $e;
 }

/daleif



--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/mtNMaldt6qI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages